virtio-gpu objects never move around, so effectively they are pinned all the time. This makes the the implementation pretty easy ;) Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/virtio/virtgpu_prime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c index b4c9199349e7..0fcae0e46abd 100644 --- a/drivers/gpu/drm/virtio/virtgpu_prime.c +++ b/drivers/gpu/drm/virtio/virtgpu_prime.c @@ -30,13 +30,13 @@ int virtgpu_gem_prime_pin(struct drm_gem_object *obj) { - WARN_ONCE(1, "not implemented"); - return -ENODEV; + /* nothing: all virtio-gpu objects are pinned all the time */ + return 0; } void virtgpu_gem_prime_unpin(struct drm_gem_object *obj) { - WARN_ONCE(1, "not implemented"); + /* nothing */ } void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj) -- 2.9.3
Den 27.02.2019 15.44, skrev Gerd Hoffmann:> virtio-gpu objects never move around, so effectively they are pinned > all the time. This makes the the implementation pretty easy ;) > > Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> > --- > drivers/gpu/drm/virtio/virtgpu_prime.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c > index b4c9199349e7..0fcae0e46abd 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_prime.c > +++ b/drivers/gpu/drm/virtio/virtgpu_prime.c > @@ -30,13 +30,13 @@ > > int virtgpu_gem_prime_pin(struct drm_gem_object *obj) > { > - WARN_ONCE(1, "not implemented"); > - return -ENODEV; > + /* nothing: all virtio-gpu objects are pinned all the time */ > + return 0; > } > > void virtgpu_gem_prime_unpin(struct drm_gem_object *obj) > { > - WARN_ONCE(1, "not implemented"); > + /* nothing */ > }You can just remove these dummies the callbacks are optional. See drm_gem_pin(). With that: Reviewed-by: Noralf Tr?nnes <noralf at tronnes.org>> > void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj) >
Reasonably Related Threads
- [PATCH v2 5/6] virtio-gpu: add basic prime support
- [PATCH v2 5/6] virtio-gpu: add basic prime support
- [PATCH 3/3] drm/virtio: implement prime export
- [PATCH AUTOSEL 5.0 85/99] Revert "drm/virtio: drop prime import/export callbacks"
- [PATCH 4/5] virtio_gpu: add basic prime support