Skip to contentSkip to conversation

drm/gem: Add drm_gem_object_funcs

PATCH Applied Noralf Trønnes 4 participants 11 messages Nov 10, 2018 – Nov 20, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover drm/gem: Add drm_gem_object_funcs

This patchset adds a GEM object function table and makes use of it in the CMA helper.

This was originally part of a shmem helper series[1] that didn't make it. Daniel and Christian showed interest in the vtable part so I have hooked it up to some refactoring in tinydrm in order to have a user. The tinydrm refactoring is part of a long term plan to get rid of tinydrm.ko.

Noralf.

[1] https://patchwork.freedesktop.org/series/27184/

Noralf Trønnes (5):
drm/driver: Add defaults for .gem_prime_export/import callbacks drm/prime: Add drm_gem_prime_mmap()
drm/gem: Add drm_gem_object_funcs
drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS drm/tinydrm: Use DRM_GEM_CMA_VMAP_DRIVER_OPS

 Documentation/gpu/todo.rst                     |  13 +++
 drivers/gpu/drm/drm_client.c                   |  12 +--
 drivers/gpu/drm/drm_gem.c                      | 109 ++++++++++++++++++--
 drivers/gpu/drm/drm_gem_cma_helper.c           |  86 ++++++++++++++++
 drivers/gpu/drm/drm_prime.c                    |  79 +++++++++++----
 drivers/gpu/drm/tinydrm/core/tinydrm-core.c    |  71 --------------
 drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c |   6 ++
 drivers/gpu/drm/tinydrm/hx8357d.c              |   4 +-
 drivers/gpu/drm/tinydrm/ili9225.c              |   5 +-
 drivers/gpu/drm/tinydrm/ili9341.c              |   4 +-
 drivers/gpu/drm/tinydrm/mi0283qt.c             |   6 +-
 drivers/gpu/drm/tinydrm/mipi-dbi.c             |  10 +-
 drivers/gpu/drm/tinydrm/repaper.c              |   4 +-
 drivers/gpu/drm/tinydrm/st7586.c               |   5 +-
 drivers/gpu/drm/tinydrm/st7735r.c              |   4 +-
 include/drm/drm_drv.h                          |   4 +
 include/drm/drm_gem.h                          | 131 +++++++++++++++++++++++++
 include/drm/drm_gem_cma_helper.h               |  24 +++++
 include/drm/drm_prime.h                        |   1 +
 include/drm/tinydrm/tinydrm.h                  |  35 ++-----
 20 files changed, 462 insertions(+), 151 deletions(-)
Signature · 6 lines
2.15.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 1/5 drm/driver: Add defaults for .gem_prime_export/import callbacks

The majority of drivers use drm_gem_prime_export() and drm_gem_prime_import() for these callbacks so let's make them the default.

---
 Documentation/gpu/todo.rst  |  7 +++++++
 drivers/gpu/drm/drm_prime.c | 10 ++++++++--
 include/drm/drm_drv.h       |  4 ++++
 3 files changed, 19 insertions(+), 2 deletions(-)
Documentation/gpu/todo.rst +7 -0
index 5c9d86c962af..abc31956ef15 100644
@@ -234,6 +234,13 @@ efficient.
 
 Contact: Daniel Vetter
 
+Defaults for .gem_prime_import and export
+-----------------------------------------
+
+Most drivers don't need to set drm_driver->gem_prime_import and
+->gem_prime_export now that drm_gem_prime_import() and drm_gem_prime_export()
+are the default.
+
 Core refactorings
 =================
 
drivers/gpu/drm/drm_prime.c +8 -2
index 8d54d51a6b6b..ba6c7e02a2ae 100644
@@ -529,7 +529,10 @@ static struct dma_buf *export_and_register_object(struct drm_device *dev,
 		return dmabuf;
 	}
 
-	dmabuf = dev->driver->gem_prime_export(dev, obj, flags);
+	if (dev->driver->gem_prime_export)
+		dmabuf = dev->driver->gem_prime_export(dev, obj, flags);
+	else
+		dmabuf = drm_gem_prime_export(dev, obj, flags);
 	if (IS_ERR(dmabuf)) {
 		/* normally the created dma-buf takes ownership of the ref,
 		 * but if that fails then drop the ref
@@ -762,7 +765,10 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev,
 
 	/* never seen this one, need to import */
 	mutex_lock(&dev->object_name_lock);
-	obj = dev->driver->gem_prime_import(dev, dma_buf);
+	if (dev->driver->gem_prime_import)
+		obj = dev->driver->gem_prime_import(dev, dma_buf);
+	else
+		obj = drm_gem_prime_import(dev, dma_buf);
 	if (IS_ERR(obj)) {
 		ret = PTR_ERR(obj);
 		goto out_unlock;
include/drm/drm_drv.h +4 -0
index 3199ef70c007..dbb2f6ad184a 100644
@@ -471,6 +471,8 @@ struct drm_driver {
 	 * @gem_prime_export:
 	 *
 	 * export GEM -> dmabuf
+	 *
+	 * This defaults to drm_gem_prime_export() if not set.
 	 */
 	struct dma_buf * (*gem_prime_export)(struct drm_device *dev,
 				struct drm_gem_object *obj, int flags);
@@ -478,6 +480,8 @@ struct drm_driver {
 	 * @gem_prime_import:
 	 *
 	 * import dmabuf -> GEM
+	 *
+	 * This defaults to drm_gem_prime_import() if not set.
 	 */
 	struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev,
 				struct dma_buf *dma_buf);
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 2/5 drm/prime: Add drm_gem_prime_mmap()

In reply to Noralf Trønnes

Add a generic PRIME GEM mmap function.

v2: Fix link in docs (Daniel Vetter)

---
 drivers/gpu/drm/drm_prime.c | 37 +++++++++++++++++++++++++++++++++++++
 include/drm/drm_prime.h     |  1 +
 2 files changed, 38 insertions(+)
drivers/gpu/drm/drm_prime.c +37 -0
index ba6c7e02a2ae..6a4fe0216e27 100644
@@ -651,6 +651,43 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev,
 }
 EXPORT_SYMBOL(drm_gem_prime_handle_to_fd);
 
+/**
+ * drm_gem_prime_mmap - PRIME mmap function for GEM drivers
+ * @obj: GEM object
+ * @vma: Virtual address range
+ *
+ * This function sets up a userspace mapping for PRIME exported buffers using
+ * the same codepath that is used for regular GEM buffer mapping on the DRM fd.
+ * The fake GEM offset is added to vma->vm_pgoff and &drm_driver->fops->mmap is
+ * called to set up the mapping.
+ *
+ * Drivers can use this as their &drm_driver.gem_prime_mmap callback.
+ */
+int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
+{
+	/* Used by drm_gem_mmap() to lookup the GEM object */
+	struct drm_file priv = {
+		.minor = obj->dev->primary,
+	};
+	struct file fil = {
+		.private_data = &priv,
+	};
+	int ret;
+
+	ret = drm_vma_node_allow(&obj->vma_node, &priv);
+	if (ret)
+		return ret;
+
+	vma->vm_pgoff += drm_vma_node_start(&obj->vma_node);
+
+	ret = obj->dev->driver->fops->mmap(&fil, vma);
+
+	drm_vma_node_revoke(&obj->vma_node, &priv);
+
+	return ret;
+}
+EXPORT_SYMBOL(drm_gem_prime_mmap);
+
 /**
  * drm_gem_prime_import_dev - core implementation of the import callback
  * @dev: drm_device to import into
include/drm/drm_prime.h +1 -0
index e2032fbc0f08..b03731a3f079 100644
@@ -70,6 +70,7 @@ struct dma_buf *drm_gem_prime_export(struct drm_device *dev,
 int drm_gem_prime_handle_to_fd(struct drm_device *dev,
 			       struct drm_file *file_priv, uint32_t handle, uint32_t flags,
 			       int *prime_fd);
+int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
 struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev,
 					    struct dma_buf *dma_buf);
 
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 3/5 drm/gem: Add drm_gem_object_funcs

In reply to Noralf Trønnes

This adds an optional function table on GEM objects.
The main benefit is for drivers that support more than one type of memory (shmem,vram,cma) for their buffers depending on the hardware it runs on. With the callbacks attached to the GEM object itself, it is easier to have core helpers for the the various buffer types. The driver only has to make the decision about buffer type on GEM object creation and all other callbacks can be handled by the chosen helper.

drm_driver->gem_prime_res_obj has not been added since there's a todo to put a reservation_object into drm_gem_object.

v3: Add todo entry

v2: Drop drm_gem_object_funcs->prime_mmap in favour of drm_gem_prime_mmap() (Daniel Vetter)

v1:
- drm_gem_object_funcs.map -> .prime_map let it only do PRIME mmap like the function it superseeds (Daniel Vetter)
- Flip around the if ladders and make obj->funcs the first choice highlighting the fact that this the new default way of doing it (Daniel Vetter)

---
 Documentation/gpu/todo.rst   |   6 ++
 drivers/gpu/drm/drm_client.c |  12 ++--
 drivers/gpu/drm/drm_gem.c    | 109 ++++++++++++++++++++++++++++++++---
 drivers/gpu/drm/drm_prime.c  |  34 ++++++-----
 include/drm/drm_gem.h        | 131 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 258 insertions(+), 34 deletions(-)
Documentation/gpu/todo.rst +6 -0
index abc31956ef15..31ef4adc91c9 100644
@@ -241,6 +241,12 @@ Most drivers don't need to set drm_driver->gem_prime_import and
 ->gem_prime_export now that drm_gem_prime_import() and drm_gem_prime_export()
 are the default.
 
+struct drm_gem_object_funcs
+---------------------------
+
+GEM objects can now have a function table instead of having the callbacks on the
+DRM driver struct. This is now the preferred way and drivers can be moved over.
+
 Core refactorings
 =================
 
drivers/gpu/drm/drm_client.c +5 -7
index 17d9a64e885e..eca7331762e4 100644
@@ -80,8 +80,7 @@ int drm_client_new(struct drm_device *dev, struct drm_client_dev *client,
 {
 	int ret;
 
-	if (!drm_core_check_feature(dev, DRIVER_MODESET) ||
-	    !dev->driver->dumb_create || !dev->driver->gem_prime_vmap)
+	if (!drm_core_check_feature(dev, DRIVER_MODESET) || !dev->driver->dumb_create)
 		return -EOPNOTSUPP;
 
 	if (funcs && !try_module_get(funcs->owner))
@@ -212,8 +211,7 @@ static void drm_client_buffer_delete(struct drm_client_buffer *buffer)
 {
 	struct drm_device *dev = buffer->client->dev;
 
-	if (buffer->vaddr && dev->driver->gem_prime_vunmap)
-		dev->driver->gem_prime_vunmap(buffer->gem, buffer->vaddr);
+	drm_gem_vunmap(buffer->gem, buffer->vaddr);
 
 	if (buffer->gem)
 		drm_gem_object_put_unlocked(buffer->gem);
@@ -266,9 +264,9 @@ drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, u
 	 * fd_install step out of the driver backend hooks, to make that
 	 * final step optional for internal users.
 	 */
-	vaddr = dev->driver->gem_prime_vmap(obj);
-	if (!vaddr) {
-		ret = -ENOMEM;
+	vaddr = drm_gem_vmap(obj);
+	if (IS_ERR(vaddr)) {
+		ret = PTR_ERR(vaddr);
 		goto err_delete;
 	}
 
drivers/gpu/drm/drm_gem.c +100 -9

151 lines not on this page · raw message

drivers/gpu/drm/drm_prime.c +16 -18
index 6a4fe0216e27..5737cb8c6f03 100644
@@ -199,7 +199,6 @@ int drm_gem_map_attach(struct dma_buf *dma_buf,
 {
 	struct drm_prime_attachment *prime_attach;
 	struct drm_gem_object *obj = dma_buf->priv;
-	struct drm_device *dev = obj->dev;
 
 	prime_attach = kzalloc(sizeof(*prime_attach), GFP_KERNEL);
 	if (!prime_attach)
@@ -208,10 +207,7 @@ int drm_gem_map_attach(struct dma_buf *dma_buf,
 	prime_attach->dir = DMA_NONE;
 	attach->priv = prime_attach;
 
-	if (!dev->driver->gem_prime_pin)
-		return 0;
-
-	return dev->driver->gem_prime_pin(obj);
+	return drm_gem_pin(obj);
 }
 EXPORT_SYMBOL(drm_gem_map_attach);
 
@@ -228,7 +224,6 @@ void drm_gem_map_detach(struct dma_buf *dma_buf,
 {
 	struct drm_prime_attachment *prime_attach = attach->priv;
 	struct drm_gem_object *obj = dma_buf->priv;
-	struct drm_device *dev = obj->dev;
 
 	if (prime_attach) {
 		struct sg_table *sgt = prime_attach->sgt;
@@ -247,8 +242,7 @@ void drm_gem_map_detach(struct dma_buf *dma_buf,
 		attach->priv = NULL;
 	}
 
-	if (dev->driver->gem_prime_unpin)
-		dev->driver->gem_prime_unpin(obj);
+	drm_gem_unpin(obj);
 }
 EXPORT_SYMBOL(drm_gem_map_detach);
 
@@ -310,7 +304,10 @@ struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,
 	if (WARN_ON(prime_attach->dir != DMA_NONE))
 		return ERR_PTR(-EBUSY);
 
-	sgt = obj->dev->driver->gem_prime_get_sg_table(obj);
+	if (obj->funcs)
+		sgt = obj->funcs->get_sg_table(obj);
+	else
+		sgt = obj->dev->driver->gem_prime_get_sg_table(obj);
 
 	if (!IS_ERR(sgt)) {
 		if (!dma_map_sg_attrs(attach->dev, sgt->sgl, sgt->nents, dir,
@@ -406,12 +403,13 @@ EXPORT_SYMBOL(drm_gem_dmabuf_release);
 void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf)
 {
 	struct drm_gem_object *obj = dma_buf->priv;
-	struct drm_device *dev = obj->dev;
+	void *vaddr;
 
-	if (dev->driver->gem_prime_vmap)
-		return dev->driver->gem_prime_vmap(obj);
-	else
-		return NULL;
+	vaddr = drm_gem_vmap(obj);
+	if (IS_ERR(vaddr))
+		vaddr = NULL;
+
+	return vaddr;
 }
 EXPORT_SYMBOL(drm_gem_dmabuf_vmap);
 
@@ -426,10 +424,8 @@ EXPORT_SYMBOL(drm_gem_dmabuf_vmap);
 void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr)
 {
 	struct drm_gem_object *obj = dma_buf->priv;
-	struct drm_device *dev = obj->dev;
 
-	if (dev->driver->gem_prime_vunmap)
-		dev->driver->gem_prime_vunmap(obj, vaddr);
+	drm_gem_vunmap(obj, vaddr);
 }
 EXPORT_SYMBOL(drm_gem_dmabuf_vunmap);
 
@@ -529,7 +525,9 @@ static struct dma_buf *export_and_register_object(struct drm_device *dev,
 		return dmabuf;
 	}
 
-	if (dev->driver->gem_prime_export)
+	if (obj->funcs && obj->funcs->export)
+		dmabuf = obj->funcs->export(obj, flags);
+	else if (dev->driver->gem_prime_export)
 		dmabuf = dev->driver->gem_prime_export(dev, obj, flags);
 	else
 		dmabuf = drm_gem_prime_export(dev, obj, flags);
include/drm/drm_gem.h +131 -0

147 lines not on this page · raw message

Signature · 6 lines
2.15.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 4/5 drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS

In reply to Noralf Trønnes

This adds functionality to the CMA helper which ensures that the kernel virtual address is set on the CMA GEM object also for imported buffers.

The drivers have been audited to ensure that none set ->vaddr on imported buffers, making the conditional dma_buf_vunmap() call in drm_gem_cma_free_object() safe.

---
 drivers/gpu/drm/drm_gem_cma_helper.c | 86 ++++++++++++++++++++++++++++++++++++
 include/drm/drm_gem_cma_helper.h     | 24 ++++++++++
 2 files changed, 110 insertions(+)
drivers/gpu/drm/drm_gem_cma_helper.c +86 -0
index 1d2ced882b66..cc26625b4b33 100644
@@ -176,6 +176,7 @@ drm_gem_cma_create_with_handle(struct drm_file *file_priv,
  *
  * This function frees the backing memory of the CMA GEM object, cleans up the
  * GEM object state and frees the memory used to store the object itself.
+ * If the buffer is imported and the virtual address is set, it is released.
  * Drivers using the CMA helpers should set this as their
  * &drm_driver.gem_free_object_unlocked callback.
  */
@@ -189,6 +190,8 @@ void drm_gem_cma_free_object(struct drm_gem_object *gem_obj)
 		dma_free_wc(gem_obj->dev->dev, cma_obj->base.size,
 			    cma_obj->vaddr, cma_obj->paddr);
 	} else if (gem_obj->import_attach) {
+		if (cma_obj->vaddr)
+			dma_buf_vunmap(gem_obj->import_attach->dmabuf, cma_obj->vaddr);
 		drm_prime_gem_destroy(gem_obj, cma_obj->sgt);
 	}
 
@@ -575,3 +578,86 @@ void drm_gem_cma_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
 	/* Nothing to do */
 }
 EXPORT_SYMBOL_GPL(drm_gem_cma_prime_vunmap);
+
+static const struct drm_gem_object_funcs drm_cma_gem_default_funcs = {
+	.free = drm_gem_cma_free_object,
+	.print_info = drm_gem_cma_print_info,
+	.get_sg_table = drm_gem_cma_prime_get_sg_table,
+	.vmap = drm_gem_cma_prime_vmap,
+	.vm_ops = &drm_gem_cma_vm_ops,
+};
+
+/**
+ * drm_cma_gem_create_object_default_funcs - Create a CMA GEM object with a
+ *                                           default function table
+ * @dev: DRM device
+ * @size: Size of the object to allocate
+ *
+ * This sets the GEM object functions to the default CMA helper functions.
+ * This function can be used as the &drm_driver.gem_create_object callback.
+ *
+ * Returns:
+ * A pointer to a allocated GEM object or an error pointer on failure.
+ */
+struct drm_gem_object *
+drm_cma_gem_create_object_default_funcs(struct drm_device *dev, size_t size)
+{
+	struct drm_gem_cma_object *cma_obj;
+
+	cma_obj = kzalloc(sizeof(*cma_obj), GFP_KERNEL);
+	if (!cma_obj)
+		return NULL;
+
+	cma_obj->base.funcs = &drm_cma_gem_default_funcs;
+
+	return &cma_obj->base;
+}
+EXPORT_SYMBOL(drm_cma_gem_create_object_default_funcs);
+
+/**
+ * drm_gem_cma_prime_import_sg_table_vmap - PRIME import another driver's
+ *	scatter/gather table and get the virtual address of the buffer
+ * @dev: DRM device
+ * @attach: DMA-BUF attachment
+ * @sgt: Scatter/gather table of pinned pages
+ *
+ * This function imports a scatter/gather table using
+ * drm_gem_cma_prime_import_sg_table() and uses dma_buf_vmap() to get the kernel
+ * virtual address. This ensures that a CMA GEM object always has its virtual
+ * address set. This address is released when the object is freed.
+ *
+ * This function can be used as the &drm_driver.gem_prime_import_sg_table
+ * callback. The DRM_GEM_CMA_VMAP_DRIVER_OPS() macro provides a shortcut to set
+ * the necessary DRM driver operations.
+ *
+ * Returns:
+ * A pointer to a newly created GEM object or an ERR_PTR-encoded negative
+ * error code on failure.
+ */
+struct drm_gem_object *
+drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *dev,
+				       struct dma_buf_attachment *attach,
+				       struct sg_table *sgt)
+{
+	struct drm_gem_cma_object *cma_obj;
+	struct drm_gem_object *obj;
+	void *vaddr;
+
+	vaddr = dma_buf_vmap(attach->dmabuf);
+	if (!vaddr) {
+		DRM_ERROR("Failed to vmap PRIME buffer\n");
+		return ERR_PTR(-ENOMEM);
+	}
+
+	obj = drm_gem_cma_prime_import_sg_table(dev, attach, sgt);
+	if (IS_ERR(obj)) {
+		dma_buf_vunmap(attach->dmabuf, vaddr);
+		return obj;
+	}
+
+	cma_obj = to_drm_gem_cma_obj(obj);
+	cma_obj->vaddr = vaddr;
+
+	return obj;
+}
+EXPORT_SYMBOL(drm_gem_cma_prime_import_sg_table_vmap);
include/drm/drm_gem_cma_helper.h +24 -0
index 19777145cf8e..07c504940ba1 100644
@@ -103,4 +103,28 @@ int drm_gem_cma_prime_mmap(struct drm_gem_object *obj,
 void *drm_gem_cma_prime_vmap(struct drm_gem_object *obj);
 void drm_gem_cma_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
 
+struct drm_gem_object *
+drm_cma_gem_create_object_default_funcs(struct drm_device *dev, size_t size);
+
+/**
+ * DRM_GEM_CMA_VMAP_DRIVER_OPS - CMA GEM driver operations ensuring a virtual
+ *                               address on the buffer
+ *
+ * This macro provides a shortcut for setting the default GEM operations in the
+ * &drm_driver structure for drivers that need the virtual address also on
+ * imported buffers.
+ */
+#define DRM_GEM_CMA_VMAP_DRIVER_OPS \
+	.gem_create_object	= drm_cma_gem_create_object_default_funcs, \
+	.dumb_create		= drm_gem_cma_dumb_create, \
+	.prime_handle_to_fd	= drm_gem_prime_handle_to_fd, \
+	.prime_fd_to_handle	= drm_gem_prime_fd_to_handle, \
+	.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table_vmap, \
+	.gem_prime_mmap		= drm_gem_prime_mmap
+
+struct drm_gem_object *
+drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *drm,
+				       struct dma_buf_attachment *attach,
+				       struct sg_table *sgt);
+
 #endif /* __DRM_GEM_CMA_HELPER_H__ */
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 4/5
#5 lore raw

Re: [PATCH 4/5] drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS

Quoted 8 lines · Noralf Trønnes

This adds functionality to the CMA helper which ensures that the kernel virtual address is set on the CMA GEM object also for imported buffers.

The drivers have been audited to ensure that none set ->vaddr on imported buffers, making the conditional dma_buf_vunmap() call in drm_gem_cma_free_object() safe.

I didn't look through 1-3 much since they had acks, but 4/5 get my:

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

PATCH 5/5 drm/tinydrm: Use DRM_GEM_CMA_VMAP_DRIVER_OPS

In reply to Noralf Trønnes

The CMA helper now has the functionality to ensure a virtual address on imported buffer so use that.

While touching all tinydrm drivers, remove the unnecessary inclusion of drm_fb_helper.h in some drivers.

Cc David Lechner <[email protected]>
Cc Eric Anholt <[email protected]>
---
 drivers/gpu/drm/tinydrm/core/tinydrm-core.c    | 71 --------------------------
 drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c |  6 +++
 drivers/gpu/drm/tinydrm/hx8357d.c              |  4 +-
 drivers/gpu/drm/tinydrm/ili9225.c              |  5 +-
 drivers/gpu/drm/tinydrm/ili9341.c              |  4 +-
 drivers/gpu/drm/tinydrm/mi0283qt.c             |  6 +--
 drivers/gpu/drm/tinydrm/mipi-dbi.c             | 10 ++--
 drivers/gpu/drm/tinydrm/repaper.c              |  4 +-
 drivers/gpu/drm/tinydrm/st7586.c               |  5 +-
 drivers/gpu/drm/tinydrm/st7735r.c              |  4 +-
 include/drm/tinydrm/tinydrm.h                  | 35 +++----------
 11 files changed, 38 insertions(+), 116 deletions(-)
drivers/gpu/drm/tinydrm/core/tinydrm-core.c +0 -71
index 9af51d982a33..01a6f2d42440 100644
@@ -36,77 +36,6 @@
  * and registers the DRM device using devm_tinydrm_register().
  */
 
-/**
- * tinydrm_gem_cma_prime_import_sg_table - Produce a CMA GEM object from
- *     another driver's scatter/gather table of pinned pages
- * @drm: DRM device to import into
- * @attach: DMA-BUF attachment
- * @sgt: Scatter/gather table of pinned pages
- *
- * This function imports a scatter/gather table exported via DMA-BUF by
- * another driver using drm_gem_cma_prime_import_sg_table(). It sets the
- * kernel virtual address on the CMA object. Drivers should use this as their
- * &drm_driver->gem_prime_import_sg_table callback if they need the virtual
- * address. tinydrm_gem_cma_free_object() should be used in combination with
- * this function.
- *
- * Returns:
- * A pointer to a newly created GEM object or an ERR_PTR-encoded negative
- * error code on failure.
- */
-struct drm_gem_object *
-tinydrm_gem_cma_prime_import_sg_table(struct drm_device *drm,
-				      struct dma_buf_attachment *attach,
-				      struct sg_table *sgt)
-{
-	struct drm_gem_cma_object *cma_obj;
-	struct drm_gem_object *obj;
-	void *vaddr;
-
-	vaddr = dma_buf_vmap(attach->dmabuf);
-	if (!vaddr) {
-		DRM_ERROR("Failed to vmap PRIME buffer\n");
-		return ERR_PTR(-ENOMEM);
-	}
-
-	obj = drm_gem_cma_prime_import_sg_table(drm, attach, sgt);
-	if (IS_ERR(obj)) {
-		dma_buf_vunmap(attach->dmabuf, vaddr);
-		return obj;
-	}
-
-	cma_obj = to_drm_gem_cma_obj(obj);
-	cma_obj->vaddr = vaddr;
-
-	return obj;
-}
-EXPORT_SYMBOL(tinydrm_gem_cma_prime_import_sg_table);
-
-/**
- * tinydrm_gem_cma_free_object - Free resources associated with a CMA GEM
- *                               object
- * @gem_obj: GEM object to free
- *
- * This function frees the backing memory of the CMA GEM object, cleans up the
- * GEM object state and frees the memory used to store the object itself using
- * drm_gem_cma_free_object(). It also handles PRIME buffers which has the kernel
- * virtual address set by tinydrm_gem_cma_prime_import_sg_table(). Drivers
- * can use this as their &drm_driver->gem_free_object_unlocked callback.
- */
-void tinydrm_gem_cma_free_object(struct drm_gem_object *gem_obj)
-{
-	if (gem_obj->import_attach) {
-		struct drm_gem_cma_object *cma_obj;
-
-		cma_obj = to_drm_gem_cma_obj(gem_obj);
-		dma_buf_vunmap(gem_obj->import_attach->dmabuf, cma_obj->vaddr);
-		cma_obj->vaddr = NULL;
-	}
-
-	drm_gem_cma_free_object(gem_obj);
-}
-EXPORT_SYMBOL_GPL(tinydrm_gem_cma_free_object);
-
 static struct drm_framebuffer *
 tinydrm_fb_create(struct drm_device *drm, struct drm_file *file_priv,
 		  const struct drm_mode_fb_cmd2 *mode_cmd)
drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +6 -0
index dcd390163a4a..bf6bfbc5d412 100644
@@ -9,12 +9,18 @@
 
 #include <linux/backlight.h>
 #include <linux/dma-buf.h>
+#include <linux/module.h>
 #include <linux/pm.h>
 #include <linux/spi/spi.h>
 #include <linux/swab.h>
 
+#include <drm/drm_device.h>
+#include <drm/drm_drv.h>
+#include <drm/drm_fourcc.h>
+#include <drm/drm_print.h>
 #include <drm/tinydrm/tinydrm.h>
 #include <drm/tinydrm/tinydrm-helpers.h>
+#include <uapi/drm/drm.h>
 
 static unsigned int spi_max;
 module_param(spi_max, uint, 0400);
drivers/gpu/drm/tinydrm/hx8357d.c +2 -2
index c3e51c2baebc..81a2bbeb25d4 100644
@@ -16,7 +16,7 @@
 #include <linux/property.h>
 #include <linux/spi/spi.h>
 
-#include <drm/drm_fb_helper.h>
+#include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_modeset_helper.h>
 #include <drm/tinydrm/mipi-dbi.h>
@@ -188,7 +188,7 @@ DEFINE_DRM_GEM_CMA_FOPS(hx8357d_fops);
 static struct drm_driver hx8357d_driver = {
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC,
 	.fops			= &hx8357d_fops,
-	TINYDRM_GEM_DRIVER_OPS,
+	DRM_GEM_CMA_VMAP_DRIVER_OPS,
 	.debugfs_init		= mipi_dbi_debugfs_init,
 	.name			= "hx8357d",
 	.desc			= "HX8357D",
drivers/gpu/drm/tinydrm/ili9225.c +3 -2
index 455fefe012f5..78f7c2d1b449 100644
@@ -20,7 +20,8 @@
 #include <linux/spi/spi.h>
 #include <video/mipi_display.h>
 
-#include <drm/drm_fb_helper.h>
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/tinydrm/mipi-dbi.h>
 #include <drm/tinydrm/tinydrm-helpers.h>
@@ -367,7 +368,7 @@ static struct drm_driver ili9225_driver = {
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 				  DRIVER_ATOMIC,
 	.fops			= &ili9225_fops,
-	TINYDRM_GEM_DRIVER_OPS,
+	DRM_GEM_CMA_VMAP_DRIVER_OPS,
 	.name			= "ili9225",
 	.desc			= "Ilitek ILI9225",
 	.date			= "20171106",
drivers/gpu/drm/tinydrm/ili9341.c +2 -2
index 6701037749a7..51395bdc6ca2 100644
@@ -15,7 +15,7 @@
 #include <linux/property.h>
 #include <linux/spi/spi.h>
 
-#include <drm/drm_fb_helper.h>
+#include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_modeset_helper.h>
 #include <drm/tinydrm/mipi-dbi.h>
@@ -144,7 +144,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9341_fops);
 static struct drm_driver ili9341_driver = {
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC,
 	.fops			= &ili9341_fops,
-	TINYDRM_GEM_DRIVER_OPS,
+	DRM_GEM_CMA_VMAP_DRIVER_OPS,
 	.debugfs_init		= mipi_dbi_debugfs_init,
 	.name			= "ili9341",
 	.desc			= "Ilitek ILI9341",
drivers/gpu/drm/tinydrm/mi0283qt.c +3 -3
index d7bb4c5e6657..3fa62e77c30b 100644
@@ -17,9 +17,9 @@
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
 
-#include <drm/drm_fb_helper.h>
-#include <drm/drm_modeset_helper.h>
+#include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_modeset_helper.h>
 #include <drm/tinydrm/mipi-dbi.h>
 #include <drm/tinydrm/tinydrm-helpers.h>
 #include <video/mipi_display.h>
@@ -153,7 +153,7 @@ static struct drm_driver mi0283qt_driver = {
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 				  DRIVER_ATOMIC,
 	.fops			= &mi0283qt_fops,
-	TINYDRM_GEM_DRIVER_OPS,
+	DRM_GEM_CMA_VMAP_DRIVER_OPS,
 	.debugfs_init		= mipi_dbi_debugfs_init,
 	.name			= "mi0283qt",
 	.desc			= "Multi-Inno MI0283QT",
drivers/gpu/drm/tinydrm/mipi-dbi.c +7 -3
index 1bb870021f6e..3a05e56f9b0d 100644
@@ -9,15 +9,19 @@
  * (at your option) any later version.
  */
 
-#include <drm/drm_gem_framebuffer_helper.h>
-#include <drm/tinydrm/mipi-dbi.h>
-#include <drm/tinydrm/tinydrm-helpers.h>
 #include <linux/debugfs.h>
 #include <linux/dma-buf.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
+
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/tinydrm/mipi-dbi.h>
+#include <drm/tinydrm/tinydrm-helpers.h>
+#include <uapi/drm/drm.h>
 #include <video/mipi_display.h>
 
 #define MIPI_DBI_MAX_SPI_READ_SPEED 2000000 /* 2MHz */
drivers/gpu/drm/tinydrm/repaper.c +3 -1
index 50a1d4216ce7..07f45a008a0f 100644
@@ -26,6 +26,8 @@
 #include <linux/spi/spi.h>
 #include <linux/thermal.h>
 
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/tinydrm/tinydrm.h>
 #include <drm/tinydrm/tinydrm-helpers.h>
@@ -882,7 +884,7 @@ static struct drm_driver repaper_driver = {
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 				  DRIVER_ATOMIC,
 	.fops			= &repaper_fops,
-	TINYDRM_GEM_DRIVER_OPS,
+	DRM_GEM_CMA_VMAP_DRIVER_OPS,
 	.name			= "repaper",
 	.desc			= "Pervasive Displays RePaper e-ink panels",
 	.date			= "20170405",
drivers/gpu/drm/tinydrm/st7586.c +3 -2
index 2fcbc3067d71..a6a8a1081b73 100644
@@ -17,7 +17,8 @@
 #include <linux/spi/spi.h>
 #include <video/mipi_display.h>
 
-#include <drm/drm_fb_helper.h>
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/tinydrm/mipi-dbi.h>
 #include <drm/tinydrm/tinydrm-helpers.h>
@@ -303,7 +304,7 @@ static struct drm_driver st7586_driver = {
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 				  DRIVER_ATOMIC,
 	.fops			= &st7586_fops,
-	TINYDRM_GEM_DRIVER_OPS,
+	DRM_GEM_CMA_VMAP_DRIVER_OPS,
 	.debugfs_init		= mipi_dbi_debugfs_init,
 	.name			= "st7586",
 	.desc			= "Sitronix ST7586",
drivers/gpu/drm/tinydrm/st7735r.c +2 -2
index 3081bc57c116..b39779e0dcd8 100644
@@ -14,7 +14,7 @@
 #include <linux/spi/spi.h>
 #include <video/mipi_display.h>
 
-#include <drm/drm_fb_helper.h>
+#include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/tinydrm/mipi-dbi.h>
 #include <drm/tinydrm/tinydrm-helpers.h>
@@ -119,7 +119,7 @@ static struct drm_driver st7735r_driver = {
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 				  DRIVER_ATOMIC,
 	.fops			= &st7735r_fops,
-	TINYDRM_GEM_DRIVER_OPS,
+	DRM_GEM_CMA_VMAP_DRIVER_OPS,
 	.debugfs_init		= mipi_dbi_debugfs_init,
 	.name			= "st7735r",
 	.desc			= "Sitronix ST7735R",
include/drm/tinydrm/tinydrm.h +7 -28
index fe9827d0ca8a..448aa5ea4722 100644
@@ -10,10 +10,15 @@
 #ifndef __LINUX_TINYDRM_H
 #define __LINUX_TINYDRM_H
 
-#include <drm/drm_gem_cma_helper.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <linux/mutex.h>
 #include <drm/drm_simple_kms_helper.h>
 
+struct drm_clip_rect;
+struct drm_driver;
+struct drm_file;
+struct drm_framebuffer;
+struct drm_framebuffer_funcs;
+
 /**
  * struct tinydrm_device - tinydrm device
  */
@@ -53,27 +58,6 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe)
 	return container_of(pipe, struct tinydrm_device, pipe);
 }
 
-/**
- * TINYDRM_GEM_DRIVER_OPS - default tinydrm gem operations
- *
- * This macro provides a shortcut for setting the tinydrm GEM operations in
- * the &drm_driver structure.
- */
-#define TINYDRM_GEM_DRIVER_OPS \
-	.gem_free_object_unlocked = tinydrm_gem_cma_free_object, \
-	.gem_print_info		= drm_gem_cma_print_info, \
-	.gem_vm_ops		= &drm_gem_cma_vm_ops, \
-	.prime_handle_to_fd	= drm_gem_prime_handle_to_fd, \
-	.prime_fd_to_handle	= drm_gem_prime_fd_to_handle, \
-	.gem_prime_import	= drm_gem_prime_import, \
-	.gem_prime_export	= drm_gem_prime_export, \
-	.gem_prime_get_sg_table	= drm_gem_cma_prime_get_sg_table, \
-	.gem_prime_import_sg_table = tinydrm_gem_cma_prime_import_sg_table, \
-	.gem_prime_vmap		= drm_gem_cma_prime_vmap, \
-	.gem_prime_vunmap	= drm_gem_cma_prime_vunmap, \
-	.gem_prime_mmap		= drm_gem_cma_prime_mmap, \
-	.dumb_create		= drm_gem_cma_dumb_create
-
 /**
  * TINYDRM_MODE - tinydrm display mode
  * @hd: Horizontal resolution, width
@@ -97,11 +81,6 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe)
 	.type = DRM_MODE_TYPE_DRIVER, \
 	.clock = 1 /* pass validation */
 
-void tinydrm_gem_cma_free_object(struct drm_gem_object *gem_obj);
-struct drm_gem_object *
-tinydrm_gem_cma_prime_import_sg_table(struct drm_device *drm,
-				      struct dma_buf_attachment *attach,
-				      struct sg_table *sgt);
 int devm_tinydrm_init(struct device *parent, struct tinydrm_device *tdev,
 		      const struct drm_framebuffer_funcs *fb_funcs,
 		      struct drm_driver *driver);
Signature · 6 lines
2.15.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

✓ Fi.CI.BAT: success for drm/gem: Add drm_gem_object_funcs

In reply to Noralf Trønnes
== Series Details ==

== Series Details ==

Series: drm/gem: Add drm_gem_object_funcs
URL : https://patchwork.freedesktop.org/series/52326/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_5118 -> Patchwork_10801 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/52326/revisions/1/mbox/

== Known issues ==

Here are the changes found in Patchwork_10801 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_contexts:
      fi-icl-u:           NOTRUN -> INCOMPLETE (fdo#108315)

    igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362, fdo#103191)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-no-display:
      fi-byt-clapper:     WARN (fdo#108688) -> PASS

    igt@drv_module_reload@basic-reload:
      fi-blb-e6850:       INCOMPLETE (fdo#107718) -> PASS

    igt@drv_selftest@live_contexts:
      fi-bsw-kefka:       DMESG-FAIL (fdo#108656) -> PASS

    igt@gem_ctx_create@basic-files:
      fi-bsw-kefka:       FAIL (fdo#108656) -> PASS

    igt@gem_mmap_gtt@basic-small-copy:
      fi-glk-dsi:         INCOMPLETE (fdo#103359, k.org#198133) -> PASS

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
      fi-byt-clapper:     FAIL (fdo#107362, fdo#103191) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-icl-u:           INCOMPLETE (fdo#107713) -> PASS

fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107713 https://bugs.freedesktop.org/show_bug.cgi?id=107713
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
fdo#108315 https://bugs.freedesktop.org/show_bug.cgi?id=108315
fdo#108656 https://bugs.freedesktop.org/show_bug.cgi?id=108656
fdo#108688 https://bugs.freedesktop.org/show_bug.cgi?id=108688
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133

== Participating hosts (53 -> 46) ==

Missing (7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510

== Build changes ==

* Linux: CI_DRM_5118 -> Patchwork_10801

CI_DRM_5118: cf670bb89853395cf2e2887eae7ed3febfb558a8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10801: 0f44e74ae1b5c36697fc57a47d229b6f6bd6645e @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

0f44e74ae1b5 drm/tinydrm: Use DRM_GEM_CMA_VMAP_DRIVER_OPS 381f307e9990 drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS 86bb0c506aaf drm/gem: Add drm_gem_object_funcs
aabcf2c14355 drm/prime: Add drm_gem_prime_mmap()
3783e072a732 drm/driver: Add defaults for .gem_prime_export/import callbacks

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10801/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

✓ Fi.CI.IGT: success for drm/gem: Add drm_gem_object_funcs

In reply to Noralf Trønnes
== Series Details ==

== Series Details ==

Series: drm/gem: Add drm_gem_object_funcs
URL : https://patchwork.freedesktop.org/series/52326/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_5118_full -> Patchwork_10801_full =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_10801_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_10801_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_10801_full:

=== IGT changes ===

    ==== Warnings ====

    igt@perf_pmu@rc6:
      shard-kbl:          SKIP -> PASS

== Known issues ==

Here are the changes found in Patchwork_10801_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drm_import_export@import-close-race-flink:
      shard-skl:          PASS -> TIMEOUT (fdo#108667)

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665, fdo#106887, fdo#106023)

    igt@kms_busy@extended-modeset-hang-newfb-render-b:
      shard-skl:          NOTRUN -> DMESG-WARN (fdo#107956) +1

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
      shard-snb:          NOTRUN -> DMESG-WARN (fdo#107956)

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-b:
      shard-hsw:          PASS -> DMESG-WARN (fdo#107956)

    igt@kms_color@pipe-a-ctm-0-75:
      shard-skl:          PASS -> FAIL (fdo#108682)

    igt@kms_draw_crc@draw-method-xrgb2101010-mmap-gtt-xtiled:
      shard-skl:          NOTRUN -> FAIL (fdo#103184)

    igt@kms_flip@2x-flip-vs-expired-vblank:
      shard-glk:          PASS -> FAIL (fdo#105363)

    igt@kms_flip@flip-vs-expired-vblank:
      shard-skl:          PASS -> FAIL (fdo#105363) +1

    igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-cpu:
      shard-skl:          NOTRUN -> FAIL (fdo#105682)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
      shard-apl:          PASS -> FAIL (fdo#103167) +1

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-fullscreen:
      shard-glk:          PASS -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@fbcpsr-1p-rte:
      shard-skl:          NOTRUN -> FAIL (fdo#103167, fdo#105682)

    igt@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-msflip-blt:
      shard-skl:          NOTRUN -> FAIL (fdo#103167) +1

    igt@kms_panel_fitting@legacy:
      shard-skl:          NOTRUN -> FAIL (fdo#105456)

    igt@kms_plane@plane-panning-bottom-right-pipe-b-planes:
      shard-skl:          PASS -> FAIL (fdo#103166)

    igt@kms_plane@plane-position-covered-pipe-b-planes:
      shard-glk:          PASS -> FAIL (fdo#103166)

    igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
      shard-skl:          NOTRUN -> FAIL (fdo#108145) +1

    igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
      shard-glk:          PASS -> FAIL (fdo#108145) +1

    igt@kms_plane_alpha_blend@pipe-b-alpha-basic:
      shard-skl:          NOTRUN -> FAIL (fdo#107815, fdo#108145) +1

    igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
      shard-apl:          PASS -> FAIL (fdo#103166) +2

    igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
      shard-skl:          NOTRUN -> FAIL (fdo#107815, fdo#103166)

    igt@kms_setmode@basic:
      shard-snb:          NOTRUN -> FAIL (fdo#99912)

    igt@perf@polling:
      shard-hsw:          PASS -> FAIL (fdo#102252)

    igt@pm_rpm@modeset-pc8-residency-stress:
      shard-skl:          SKIP -> INCOMPLETE (fdo#107807)

    igt@pm_rpm@reg-read-ioctl:
      shard-skl:          PASS -> INCOMPLETE (fdo#107807)

    
    ==== Possible fixes ====

    igt@gem_ctx_isolation@bcs0-s3:
      shard-skl:          INCOMPLETE (fdo#107773, fdo#104108) -> PASS

    igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
      shard-glk:          FAIL (fdo#108145) -> PASS

    igt@kms_chv_cursor_fail@pipe-c-256x256-top-edge:
      shard-skl:          FAIL (fdo#104671) -> PASS

    igt@kms_color@pipe-c-ctm-blue-to-red:
      shard-skl:          FAIL (fdo#107201) -> PASS

    igt@kms_cursor_crc@cursor-256x256-sliding:
      shard-apl:          FAIL (fdo#103232) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-gtt:
      shard-apl:          FAIL (fdo#103167) -> PASS

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
      shard-glk:          FAIL (fdo#103167) -> PASS +1

    igt@kms_plane@pixel-format-pipe-b-planes:
      shard-apl:          FAIL (fdo#103166) -> PASS

    igt@kms_plane@plane-position-covered-pipe-b-planes:
      shard-kbl:          DMESG-WARN (fdo#103313) -> PASS

    igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
      shard-glk:          FAIL (fdo#103166) -> PASS +2

    igt@pm_rpm@pc8-residency:
      shard-skl:          INCOMPLETE (fdo#107807) -> SKIP

fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#104671 https://bugs.freedesktop.org/show_bug.cgi?id=104671
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105456 https://bugs.freedesktop.org/show_bug.cgi?id=105456
fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106887 https://bugs.freedesktop.org/show_bug.cgi?id=106887
fdo#107201 https://bugs.freedesktop.org/show_bug.cgi?id=107201
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
fdo#107815 https://bugs.freedesktop.org/show_bug.cgi?id=107815
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
fdo#108667 https://bugs.freedesktop.org/show_bug.cgi?id=108667
fdo#108682 https://bugs.freedesktop.org/show_bug.cgi?id=108682
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (6 -> 6) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_5118 -> Patchwork_10801

CI_DRM_5118: cf670bb89853395cf2e2887eae7ed3febfb558a8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10801: 0f44e74ae1b5c36697fc57a47d229b6f6bd6645e @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10801/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Acked-by on the v1 series
#9 lore raw
In reply to Noralf Trønnes

Am 10.11.18 um 15:56 schrieb Noralf Trønnes:

Quoted 11 lines

This patchset adds a GEM object function table and makes use of it in the CMA helper.

This was originally part of a shmem helper series[1] that didn't make it. Daniel and Christian showed interest in the vtable part so I have hooked it up to some refactoring in tinydrm in order to have a user. The tinydrm refactoring is part of a long term plan to get rid of tinydrm.ko.

Noralf.

Quoted 8 lines

[1] https://patchwork.freedesktop.org/series/27184/

Noralf Trønnes (5):
drm/driver: Add defaults for .gem_prime_export/import callbacks drm/prime: Add drm_gem_prime_mmap()
drm/gem: Add drm_gem_object_funcs
drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS drm/tinydrm: Use DRM_GEM_CMA_VMAP_DRIVER_OPS

Regards,
Christian.

Quoted 14 lines
  Documentation/gpu/todo.rst                     |  13 +++
  drivers/gpu/drm/drm_client.c                   |  12 +--
  drivers/gpu/drm/drm_gem.c                      | 109 ++++++++++++++++++--
  drivers/gpu/drm/drm_gem_cma_helper.c           |  86 ++++++++++++++++
  drivers/gpu/drm/drm_prime.c                    |  79 +++++++++++----
  drivers/gpu/drm/tinydrm/core/tinydrm-core.c    |  71 --------------
  drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c |   6 ++
  drivers/gpu/drm/tinydrm/hx8357d.c              |   4 +-
  drivers/gpu/drm/tinydrm/ili9225.c              |   5 +-
  drivers/gpu/drm/tinydrm/ili9341.c              |   4 +-
  drivers/gpu/drm/tinydrm/mi0283qt.c             |   6 +-
  drivers/gpu/drm/tinydrm/mipi-dbi.c             |  10 +-
  drivers/gpu/drm/tinydrm/repaper.c              |   4 +-
Quoted 9 lines
  drivers/gpu/drm/tinydrm/st7586.c               |   5 +-
  drivers/gpu/drm/tinydrm/st7735r.c              |   4 +-
  include/drm/drm_drv.h                          |   4 +
  include/drm/drm_gem.h                          | 131 +++++++++++++++++++++++++
  include/drm/drm_gem_cma_helper.h               |  24 +++++
  include/drm/drm_prime.h                        |   1 +
  include/drm/tinydrm/tinydrm.h                  |  35 ++-----
  20 files changed, 462 insertions(+), 151 deletions(-)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author Applied
#10 lore raw
In reply to Noralf Trønnes

Den 10.11.2018 15.56, skrev Noralf Trønnes:

Quoted 11 lines

This patchset adds a GEM object function table and makes use of it in the CMA helper.

This was originally part of a shmem helper series[1] that didn't make it. Daniel and Christian showed interest in the vtable part so I have hooked it up to some refactoring in tinydrm in order to have a user. The tinydrm refactoring is part of a long term plan to get rid of tinydrm.ko.

Noralf.

Quoted 8 lines

[1] https://patchwork.freedesktop.org/series/27184/

Noralf Trønnes (5):
drm/driver: Add defaults for .gem_prime_export/import callbacks drm/prime: Add drm_gem_prime_mmap()
drm/gem: Add drm_gem_object_funcs
drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS drm/tinydrm: Use DRM_GEM_CMA_VMAP_DRIVER_OPS

Applied to drm-misc-next. Thanks for ack and review.

Noralf.

Quoted 13 lines
  Documentation/gpu/todo.rst                     |  13 +++
  drivers/gpu/drm/drm_client.c                   |  12 +--
  drivers/gpu/drm/drm_gem.c                      | 109 ++++++++++++++++++--
  drivers/gpu/drm/drm_gem_cma_helper.c           |  86 ++++++++++++++++
  drivers/gpu/drm/drm_prime.c                    |  79 +++++++++++----
  drivers/gpu/drm/tinydrm/core/tinydrm-core.c    |  71 --------------
  drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c |   6 ++
  drivers/gpu/drm/tinydrm/hx8357d.c              |   4 +-
  drivers/gpu/drm/tinydrm/ili9225.c              |   5 +-
  drivers/gpu/drm/tinydrm/ili9341.c              |   4 +-
  drivers/gpu/drm/tinydrm/mi0283qt.c             |   6 +-
  drivers/gpu/drm/tinydrm/mipi-dbi.c             |  10 +-
  drivers/gpu/drm/tinydrm/repaper.c              |   4 +-
Quoted 9 lines
  drivers/gpu/drm/tinydrm/st7586.c               |   5 +-
  drivers/gpu/drm/tinydrm/st7735r.c              |   4 +-
  include/drm/drm_drv.h                          |   4 +
  include/drm/drm_gem.h                          | 131 +++++++++++++++++++++++++
  include/drm/drm_gem_cma_helper.h               |  24 +++++
  include/drm/drm_prime.h                        |   1 +
  include/drm/tinydrm/tinydrm.h                  |  35 ++-----
  20 files changed, 462 insertions(+), 151 deletions(-)

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx