[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0c959f3a-15e9-8295-dc11-2f6b9a4229ac@tronnes.org>
Date: Wed, 3 Apr 2019 11:58:06 +0200
From: Noralf Trønnes <noralf@...nnes.org>
To: Gerd Hoffmann <kraxel@...hat.com>, Daniel Vetter <daniel@...ll.ch>
Cc: David Airlie <airlied@...ux.ie>, Dave Airlie <airlied@...hat.com>,
open list <linux-kernel@...r.kernel.org>,
dri-devel <dri-devel@...ts.freedesktop.org>,
"open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE"
<virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH] drm/cirrus: rewrite and modernize driver.
Den 03.04.2019 10.53, skrev Gerd Hoffmann:
>>> +struct cirrus_device {
>>> + struct drm_device *dev;
>>
>> Why not embed drm_device? It's the latest rage :-)
>
> Sure, can do that.
>
>>> +void cirrus_pipe_update(struct drm_simple_display_pipe *pipe,
>>> + struct drm_plane_state *old_state)
>>> +{
>>> + struct drm_plane_state *state = pipe->plane.state;
>>> + struct drm_crtc *crtc = &pipe->crtc;
>>> + struct drm_rect rect;
>>> +
>>> + if (drm_atomic_helper_damage_merged(old_state, state, &rect))
>>> + cirrus_fb_blit_rect(pipe->plane.state->fb, &rect);
>>> +
>>> + if (crtc->state->event) {
>>> + spin_lock_irq(&crtc->dev->event_lock);
>>> + drm_crtc_send_vblank_event(crtc, crtc->state->event);
>>> + spin_unlock_irq(&crtc->dev->event_lock);
>>> + crtc->state->event = NULL;
>>> + }
>>> +}
>
>>> +static int cirrus_fb_dirty(struct drm_framebuffer *fb,
>>> + struct drm_file *file_priv,
>>> + unsigned int flags, unsigned int color,
>>> + struct drm_clip_rect *clips,
>>> + unsigned int num_clips)
>>> +{
>>> + struct cirrus_device *cirrus = fb->dev->dev_private;
>>> +
>>> + if (cirrus->pipe.plane.state->fb != fb)
>>> + return 0;
>>> +
>>> + if (num_clips)
>>> + cirrus_fb_blit_clips(fb, clips, num_clips);
>>> + else
>>> + cirrus_fb_blit_fullscreen(fb);
>>> + return 0;
>>> +}
>>
>> Why not use the dirty helpers and implement dirty rect support in your
>> main plane update function?
>
> Dirty rect support is already there, see above.
>
> So I can just remove cirrus_fb_dirty() and hook up
> drm_atomic_helper_dirtyfb() instead. Easy ;)
>
You can even use drm_gem_fb_create_with_dirty() instead of
drm_gem_fb_create_with_funcs().
Noralf.
> cheers,
> Gerd
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Powered by blists - more mailing lists