On Mon, 12 Oct 2020 11:59:03 +0100 Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxx> > > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > > Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx> > > Cc: Maxime Ripard <mripard@xxxxxxxxxx> > > Cc: Thomas Zimmermann <tzimmermann@xxxxxxx> > > Cc: David Airlie <airlied@xxxxxxxx> > > Cc: Daniel Vetter <daniel@xxxxxxxx> > > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@xxxxxxxxx> > > Cc: Melissa Wen <melissa.srw@xxxxxxxxx> > > Cc: Haneen Mohammed <hamohammed.sa@xxxxxxxxx> > > --- > > 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@xxxxxxxxxxxxxxxxxx> > -Chris _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel