Add create_handle support to virtio fb. Without this, screenshot tool in chromium OS can't work. Signed-off-by: Lepton Wu <ytht.net at gmail.com> --- drivers/gpu/drm/virtio/virtgpu_display.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index b6d52055a11f..274b4206ca96 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -71,7 +71,19 @@ virtio_gpu_framebuffer_surface_dirty(struct drm_framebuffer *fb, return virtio_gpu_surface_dirty(virtio_gpu_fb, clips, num_clips); } +static int +virtio_gpu_framebuffer_create_handle(struct drm_framebuffer *fb, + struct drm_file *file_priv, + unsigned int *handle) +{ + struct virtio_gpu_framebuffer *virtio_gpu_fb + to_virtio_gpu_framebuffer(fb); + + return drm_gem_handle_create(file_priv, virtio_gpu_fb->obj, handle); +} + static const struct drm_framebuffer_funcs virtio_gpu_fb_funcs = { + .create_handle = virtio_gpu_framebuffer_create_handle, .destroy = virtio_gpu_user_framebuffer_destroy, .dirty = virtio_gpu_framebuffer_surface_dirty, }; -- 2.15.0.403.gc27cc4dac6-goog
Ping. On Wed, Nov 8, 2017 at 10:42 AM, Lepton Wu <ytht.net at gmail.com> wrote:> Add create_handle support to virtio fb. Without this, screenshot tool > in chromium OS can't work. > > Signed-off-by: Lepton Wu <ytht.net at gmail.com> > --- > drivers/gpu/drm/virtio/virtgpu_display.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c > index b6d52055a11f..274b4206ca96 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_display.c > +++ b/drivers/gpu/drm/virtio/virtgpu_display.c > @@ -71,7 +71,19 @@ virtio_gpu_framebuffer_surface_dirty(struct drm_framebuffer *fb, > return virtio_gpu_surface_dirty(virtio_gpu_fb, clips, num_clips); > } > > +static int > +virtio_gpu_framebuffer_create_handle(struct drm_framebuffer *fb, > + struct drm_file *file_priv, > + unsigned int *handle) > +{ > + struct virtio_gpu_framebuffer *virtio_gpu_fb > + to_virtio_gpu_framebuffer(fb); > + > + return drm_gem_handle_create(file_priv, virtio_gpu_fb->obj, handle); > +} > + > static const struct drm_framebuffer_funcs virtio_gpu_fb_funcs = { > + .create_handle = virtio_gpu_framebuffer_create_handle, > .destroy = virtio_gpu_user_framebuffer_destroy, > .dirty = virtio_gpu_framebuffer_surface_dirty, > }; > -- > 2.15.0.403.gc27cc4dac6-goog >
On Mon, Nov 13, 2017 at 02:19:29PM -0800, lepton wrote:> Ping. > > On Wed, Nov 8, 2017 at 10:42 AM, Lepton Wu <ytht.net at gmail.com> wrote: > > Add create_handle support to virtio fb. Without this, screenshot tool > > in chromium OS can't work.Already queued up in drm-misc-next (the cirrus patch too). cheers, Gerd