mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Gerd Hoffmann <kraxel@redhat.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>, Dave Airlie <airlied@redhat.com>,
	open list <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" 
	<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH] drm/cirrus: rewrite and modernize driver.
Date: Wed, 3 Apr 2019 11:58:06 +0200	[thread overview]
Message-ID: <0c959f3a-15e9-8295-dc11-2f6b9a4229ac@tronnes.org> (raw)
In-Reply-To: <20190403085341.2cxdgxqrjlwecx3n@sirius.home.kraxel.org>



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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

  reply	other threads:[~2019-04-03  9:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03  7:23 Gerd Hoffmann
2019-04-03  7:47 ` Daniel Vetter
2019-04-03  8:53   ` Gerd Hoffmann
2019-04-03  9:58     ` Noralf Trønnes [this message]
2019-04-03 10:27       ` Gerd Hoffmann
2019-04-03 15:12 ` Adam Jackson
2019-04-03 15:15   ` Daniel Stone
2019-04-03 15:52     ` Adam Jackson
2019-04-04  2:58 ` David Airlie
2019-04-04  5:50   ` Gerd Hoffmann
2019-04-04  6:31     ` Daniel Vetter
2019-04-04  7:09       ` Gerd Hoffmann
2019-04-04  8:30       ` Gerd Hoffmann
2019-04-04  8:52         ` Daniel Vetter
2019-04-04 10:06           ` Noralf Trønnes
2019-04-04 10:27             ` Gerd Hoffmann
2019-04-04 11:45               ` Noralf Trønnes
2019-04-04 11:45               ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c959f3a-15e9-8295-dc11-2f6b9a4229ac@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®