Merge tag ‘drm-intel-fixes-2019-04-24’ of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes [Linux 5.1]

Merge tag ‘drm-intel-fixes-2019-04-24’ of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes [Linux 5.1]

This Linux kernel change "Merge tag ‘drm-intel-fixes-2019-04-24’ of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes" is included in the Linux 5.1 release. This change is authored by Dave Airlie <airlied [at] redhat.com> on Fri Apr 26 10:13:49 2019 +1000. The commit for this change in Linux stable tree is b3a39c7 (patch). Other info about this change: Merge: a0cecc2 f5c58ba

Merge tag 'drm-intel-fixes-2019-04-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes

A fix for display lanes calculation for BXT and a protection
to avoid enabling FEC without DSC.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190424215359.GA26100@intel.com

There is no are 0 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/gpu/drm/virtio/virtgpu_drv.c   |  4 ++++
 drivers/gpu/drm/virtio/virtgpu_drv.h   |  4 ++++
 drivers/gpu/drm/virtio/virtgpu_prime.c | 12 ++++++++++++
 3 files changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index b996ac1d..af92964 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -205,10 +205,14 @@ static void virtio_gpu_config_changed(struct virtio_device *vdev)
 #if defined(CONFIG_DEBUG_FS)
    .debugfs_init = virtio_gpu_debugfs_init,
 #endif
+   .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
+   .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
    .gem_prime_export = drm_gem_prime_export,
    .gem_prime_import = drm_gem_prime_import,
    .gem_prime_pin = virtgpu_gem_prime_pin,
    .gem_prime_unpin = virtgpu_gem_prime_unpin,
+   .gem_prime_get_sg_table = virtgpu_gem_prime_get_sg_table,
+   .gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table,
    .gem_prime_vmap = virtgpu_gem_prime_vmap,
    .gem_prime_vunmap = virtgpu_gem_prime_vunmap,
    .gem_prime_mmap = virtgpu_gem_prime_mmap,
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 3238fdf..d577cb7 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -354,6 +354,10 @@ int virtio_gpu_object_get_sg_table(struct virtio_gpu_device *qdev,
 /* virtgpu_prime.c */
 int virtgpu_gem_prime_pin(struct drm_gem_object *obj);
 void virtgpu_gem_prime_unpin(struct drm_gem_object *obj);
+struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj);
+struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
+   struct drm_device *dev, struct dma_buf_attachment *attach,
+   struct sg_table *sgt);
 void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj);
 void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
 int virtgpu_gem_prime_mmap(struct drm_gem_object *obj,
diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c
index c59ec34..eb51a78 100644
--- a/drivers/gpu/drm/virtio/virtgpu_prime.c
+++ b/drivers/gpu/drm/virtio/virtgpu_prime.c
@@ -39,6 +39,18 @@ void virtgpu_gem_prime_unpin(struct drm_gem_object *obj)
    WARN_ONCE(1, "not implemented");
 }

+struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj)
+{
+   return ERR_PTR(-ENODEV);
+}
+
+struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
+   struct drm_device *dev, struct dma_buf_attachment *attach,
+   struct sg_table *table)
+{
+   return ERR_PTR(-ENODEV);
+}
+
 void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj)
 {
    struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj);

Leave a Reply

Your email address will not be published. Required fields are marked *