All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Melissa Wen <melissa.srw@gmail.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 2/3] drm/vkms: Switch to shmem helpers
Date: Mon, 12 Oct 2020 13:20:30 +0200	[thread overview]
Message-ID: <20201012132030.0b8a48ae@linux-uq9g> (raw)
In-Reply-To: <160250034327.30484.13309178658036116683@build.alporthouse.com>

On Mon, 12 Oct 2020 11:59:03 +0100 Chris Wilson <chris@chris-wilson.co.uk>
wrote:

> Quoting Daniel Vetter (2020-10-10 00:21:55)
> > Inspired by a patch by Chris Wilson for vgem. Plus this gives us vmap
> > at the gem bo level, which we need for generic fbdev emulation.
> > 
> > Luckily shmem also tracks ->vaddr, so we just need to adjust the code
> > all over a bit to make this fit.
> > 
> > Also wire up handle_to_fd, dunno why that was missing.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > Cc: Melissa Wen <melissa.srw@gmail.com>
> > Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> > ---
> > diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c
> > index 33c031f27c2c..66c6842d70db 100644
> > --- a/drivers/gpu/drm/vkms/vkms_composer.c
> > +++ b/drivers/gpu/drm/vkms/vkms_composer.c
> > @@ -5,6 +5,7 @@
> >  #include <drm/drm_atomic.h>
> >  #include <drm/drm_atomic_helper.h>
> >  #include <drm/drm_gem_framebuffer_helper.h>
> > +#include <drm/drm_gem_shmem_helper.h>
> >  #include <drm/drm_vblank.h>
> 
> >  static void vkms_release(struct drm_device *dev)
> >  {
> > @@ -91,9 +82,11 @@ static struct drm_driver vkms_driver = {
> >         .driver_features        = DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_GEM,
> >         .release                = vkms_release,
> >         .fops                   = &vkms_driver_fops,
> > -       .dumb_create            = vkms_dumb_create,
> > +       .dumb_create            = drm_gem_shmem_dumb_create,
> 
> Something worth pointing out is that will create an uncached (well WC)
> buffer, but since it is being exported with prime, that is probably for

I'd rather set .gem_create_object to drm_gem_shmem_create_object_cached() to
get cached memory. We already have other drivers that do this.

Best regards
Thomas


> the better. It might be worth using a memcpy_from_wc() for writeback/CRC
> calculations. E.g.
> 
> > @@ -129,15 +130,15 @@ static void compose_cursor(struct vkms_composer *cursor_composer,
> >                            void *vaddr_out)
> >  {
> > +       blend(vaddr_out, cursor_shmem_obj->vaddr,
> >               primary_composer, cursor_composer);
> >  }
> >  
> > @@ -147,20 +148,20 @@ static int compose_planes(void **vaddr_out,
> >  {
> > +       memcpy(*vaddr_out, shmem_obj->vaddr, shmem_obj->base.size);
> 
> would benefit from WC accessors.
> 
> On the other hand, if the load is so small no one notices, it can wait.
> 
> Do we have anything that uses vkms in CI?
> 
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> -Chris

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-10-12 11:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 23:21 [PATCH 1/3] drm/vkms: Set preferred depth correctly Daniel Vetter
2020-10-09 23:21 ` [PATCH 2/3] drm/vkms: Switch to shmem helpers Daniel Vetter
2020-10-12 10:59   ` Chris Wilson
2020-10-12 11:20     ` Thomas Zimmermann [this message]
2020-10-12 11:22   ` Thomas Zimmermann
2020-10-12 12:41   ` Melissa Wen
2020-10-13 11:10   ` [PATCH] " Daniel Vetter
2020-10-09 23:21 ` [PATCH 3/3] drm/vkms: fbdev emulation support Daniel Vetter
2020-10-12 11:24   ` Thomas Zimmermann
2020-10-12 12:40     ` Neil Armstrong
2020-10-12 14:23       ` Daniel Vetter
2020-10-13  6:14         ` Pekka Paalanen
2020-10-13  7:53           ` Daniel Vetter
2020-10-13 10:19             ` Pekka Paalanen
2020-10-13 11:03               ` Daniel Vetter
2020-10-16 10:10   ` Melissa Wen
2020-10-20  8:34     ` Daniel Vetter
2020-10-12 11:08 ` [PATCH 1/3] drm/vkms: Set preferred depth correctly Thomas Zimmermann
2020-10-12 12:59 ` Melissa Wen
2020-10-15 21:39   ` Daniel Vetter
2020-10-16 10:18     ` Melissa Wen
2020-10-16 10:38 ` Simon Ser
2020-10-16 11:35   ` Daniel Vetter
2020-10-16 17:02     ` Melissa Wen
2020-10-16 17:05       ` Daniel Vetter
2020-10-17  8:39         ` Melissa Wen
2020-10-17 15:23           ` Daniel Vetter
2020-10-27 10:13     ` Thomas Zimmermann
2020-10-27 10:18       ` Daniel Vetter

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=20201012132030.0b8a48ae@linux-uq9g \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=melissa.srw@gmail.com \
    --cc=rodrigosiqueiramelo@gmail.com \
    --subject='Re: [PATCH 2/3] drm/vkms: Switch to shmem helpers' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.