All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] drm documentation and clean ups
@ 2016-12-28 14:32 Gabriel Krisman Bertazi
  2016-12-28 14:32 ` [PATCH 1/6] drm: Deduplicate driver initialization message Gabriel Krisman Bertazi
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-12-28 14:32 UTC (permalink / raw)
  To: daniel.vetter; +Cc: Gabriel Krisman Bertazi, dri-devel

Hi,

Here is a first batch of cleanups and documentation improvements to get
me started on the DRM subsystem.  I'm crawling through the newbie's
page, and should share patches for load/unload callbacks removal next,
once I properly test them.

Thanks,

Gabriel Krisman Bertazi (6):
  drm: Deduplicate driver initialization message
  exynos_drm: Clean up duplicated assignment in exynos_drm_driver
  drm: Drop unused forward declaration of drm_version
  drm: Export drm_ioctl_permit to kernel-doc
  drm: Document deprecated load/unload hook
  drm: Update TTM initialization documentation

 Documentation/gpu/drm-mm.rst                    | 30 ++++++++++++++-----------
 drivers/gpu/drm/armada/armada_drv.c             |  6 -----
 drivers/gpu/drm/drm_drv.c                       |  7 ++++++
 drivers/gpu/drm/drm_global.c                    | 23 +++++++++++++++++++
 drivers/gpu/drm/drm_ioctl.c                     | 11 +++++----
 drivers/gpu/drm/drm_pci.c                       |  4 ----
 drivers/gpu/drm/drm_platform.c                  |  4 ----
 drivers/gpu/drm/exynos/exynos_drm_drv.c         |  1 -
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       |  4 ----
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c |  4 ----
 drivers/gpu/drm/tegra/drm.c                     |  4 ----
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c        |  4 ----
 include/drm/drm_drv.h                           | 30 +++++++++++++++++++++++++
 13 files changed, 82 insertions(+), 50 deletions(-)

-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/6] drm: Deduplicate driver initialization message
  2016-12-28 14:32 [PATCH 0/6] drm documentation and clean ups Gabriel Krisman Bertazi
@ 2016-12-28 14:32 ` Gabriel Krisman Bertazi
  2016-12-30 11:38   ` Daniel Vetter
  2016-12-28 14:32 ` [PATCH 2/6] exynos_drm: Clean up duplicated assignment in exynos_drm_driver Gabriel Krisman Bertazi
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-12-28 14:32 UTC (permalink / raw)
  To: daniel.vetter; +Cc: Gabriel Krisman Bertazi, dri-devel

Several DRM drivers print the same initialization message right after
drm_dev_register, so move that to common code.  The exception is i915,
which uses its own register handle, so let it keep its own message.

Notice that this was tested only with Exynos, but looks simple enough
for the other drivers.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 drivers/gpu/drm/armada/armada_drv.c             | 6 ------
 drivers/gpu/drm/drm_drv.c                       | 7 +++++++
 drivers/gpu/drm/drm_pci.c                       | 4 ----
 drivers/gpu/drm/drm_platform.c                  | 4 ----
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 4 ----
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ----
 drivers/gpu/drm/tegra/drm.c                     | 4 ----
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c        | 4 ----
 8 files changed, 7 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 07086b427c22..63f42d001f33 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -203,12 +203,6 @@ static int armada_drm_bind(struct device *dev)
 	armada_drm_debugfs_init(priv->drm.primary);
 #endif
 
-	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
-		 armada_drm_driver.name, armada_drm_driver.major,
-		 armada_drm_driver.minor, armada_drm_driver.patchlevel,
-		 armada_drm_driver.date, dev_name(dev),
-		 priv->drm.primary->index);
-
 	return 0;
 
  err_poll:
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 4a7b3e98d586..d5aeba58c2ac 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -728,6 +728,7 @@ static void remove_compat_control_link(struct drm_device *dev)
  */
 int drm_dev_register(struct drm_device *dev, unsigned long flags)
 {
+	struct drm_driver *driver = dev->driver;
 	int ret;
 
 	mutex_lock(&drm_global_mutex);
@@ -758,6 +759,12 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
 		drm_modeset_register_all(dev);
 
 	ret = 0;
+
+	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
+		 driver->name, driver->major, driver->minor,
+		 driver->patchlevel, driver->date, dev_name(dev->dev),
+		 dev->primary->index);
+
 	goto out_unlock;
 
 err_minors:
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 3ceea9cb9d3e..dc358f860aea 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -257,10 +257,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
 	if (ret)
 		goto err_agp;
 
-	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
-		 driver->name, driver->major, driver->minor, driver->patchlevel,
-		 driver->date, pci_name(pdev), dev->primary->index);
-
 	/* No locking needed since shadow-attach is single-threaded since it may
 	 * only be called from the per-driver module init hook. */
 	if (drm_core_check_feature(dev, DRIVER_LEGACY))
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
index 026269851ce9..7af3005a030c 100644
--- a/drivers/gpu/drm/drm_platform.c
+++ b/drivers/gpu/drm/drm_platform.c
@@ -57,10 +57,6 @@ static int drm_get_platform_dev(struct platform_device *platdev,
 	if (ret)
 		goto err_free;
 
-	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
-		 driver->name, driver->major, driver->minor, driver->patchlevel,
-		 driver->date, dev->primary->index);
-
 	return 0;
 
 err_free:
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 0b35da73c2b0..9a31711d5158 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -415,10 +415,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto unref;
 
-	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
-		 driver->major, driver->minor, driver->patchlevel,
-		 driver->date, drm->primary->index);
-
 	return 0;
 
 unref:
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index fa228b7b022c..7df0e8535e41 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -217,10 +217,6 @@ static int kirin_drm_bind(struct device *dev)
 	if (ret)
 		goto err_kms_cleanup;
 
-	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
-		 driver->name, driver->major, driver->minor, driver->patchlevel,
-		 driver->date, drm_dev->primary->index);
-
 	return 0;
 
 err_kms_cleanup:
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index e289dbc6ad82..1acf1da3f0df 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -992,10 +992,6 @@ static int host1x_drm_probe(struct host1x_device *dev)
 	if (err < 0)
 		goto unref;
 
-	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
-		 driver->major, driver->minor, driver->patchlevel,
-		 driver->date, drm->primary->index);
-
 	return 0;
 
 unref:
diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
index 3b97d50fd392..43e1d5916c6c 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
@@ -83,10 +83,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
 	if (ret)
 		goto err_free;
 
-	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
-		 driver->major, driver->minor, driver->patchlevel,
-		 driver->date, dev->primary->index);
-
 	return 0;
 
 err_free:
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/6] exynos_drm: Clean up duplicated assignment in exynos_drm_driver
  2016-12-28 14:32 [PATCH 0/6] drm documentation and clean ups Gabriel Krisman Bertazi
  2016-12-28 14:32 ` [PATCH 1/6] drm: Deduplicate driver initialization message Gabriel Krisman Bertazi
@ 2016-12-28 14:32 ` Gabriel Krisman Bertazi
  2017-06-19 11:03   ` Andrzej Hajda
  2016-12-28 14:32 ` [PATCH 3/6] drm: Drop unused forward declaration of drm_version Gabriel Krisman Bertazi
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-12-28 14:32 UTC (permalink / raw)
  To: daniel.vetter; +Cc: Gabriel Krisman Bertazi, dri-devel

num_ioctls is already assigned when declaring the exynos_drm_driver
structure.  No need to duplicate it here.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 739180ac3da5..44b4d07eefb5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -570,7 +570,6 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
 	struct component_match *match;
 
 	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
-	exynos_drm_driver.num_ioctls = ARRAY_SIZE(exynos_ioctls);
 
 	match = exynos_drm_match_add(&pdev->dev);
 	if (IS_ERR(match))
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/6] drm: Drop unused forward declaration of drm_version
  2016-12-28 14:32 [PATCH 0/6] drm documentation and clean ups Gabriel Krisman Bertazi
  2016-12-28 14:32 ` [PATCH 1/6] drm: Deduplicate driver initialization message Gabriel Krisman Bertazi
  2016-12-28 14:32 ` [PATCH 2/6] exynos_drm: Clean up duplicated assignment in exynos_drm_driver Gabriel Krisman Bertazi
@ 2016-12-28 14:32 ` Gabriel Krisman Bertazi
  2016-12-28 14:32 ` [PATCH 4/6] drm: Export drm_ioctl_permit to kernel-doc Gabriel Krisman Bertazi
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-12-28 14:32 UTC (permalink / raw)
  To: daniel.vetter; +Cc: Gabriel Krisman Bertazi, dri-devel

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 drivers/gpu/drm/drm_ioctl.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index d180673c1323..5c80e720aeca 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -95,9 +95,6 @@
  * broken.
  */
 
-static int drm_version(struct drm_device *dev, void *data,
-		       struct drm_file *file_priv);
-
 /*
  * Get the bus id.
  *
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/6] drm: Export drm_ioctl_permit to kernel-doc
  2016-12-28 14:32 [PATCH 0/6] drm documentation and clean ups Gabriel Krisman Bertazi
                   ` (2 preceding siblings ...)
  2016-12-28 14:32 ` [PATCH 3/6] drm: Drop unused forward declaration of drm_version Gabriel Krisman Bertazi
@ 2016-12-28 14:32 ` Gabriel Krisman Bertazi
  2016-12-28 14:32 ` [PATCH 5/6] drm: Document deprecated load/unload hook Gabriel Krisman Bertazi
  2016-12-28 14:32 ` [PATCH 6/6] drm: Update TTM initialization documentation Gabriel Krisman Bertazi
  5 siblings, 0 replies; 16+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-12-28 14:32 UTC (permalink / raw)
  To: daniel.vetter; +Cc: Gabriel Krisman Bertazi, dri-devel

drm_ioctl_permit is exported but missed a kernel-doc style
documentation.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 drivers/gpu/drm/drm_ioctl.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 5c80e720aeca..a7c61c23685a 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -478,15 +478,17 @@ static int drm_version(struct drm_device *dev, void *data,
 	return err;
 }
 
-/*
+/**
  * drm_ioctl_permit - Check ioctl permissions against caller
  *
  * @flags: ioctl permission flags.
  * @file_priv: Pointer to struct drm_file identifying the caller.
  *
  * Checks whether the caller is allowed to run an ioctl with the
- * indicated permissions. If so, returns zero. Otherwise returns an
- * error code suitable for ioctl return.
+ * indicated permissions.
+ *
+ * Returns:
+ * Zero if allowed, -EACCES otherwise.
  */
 int drm_ioctl_permit(u32 flags, struct drm_file *file_priv)
 {
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/6] drm: Document deprecated load/unload hook
  2016-12-28 14:32 [PATCH 0/6] drm documentation and clean ups Gabriel Krisman Bertazi
                   ` (3 preceding siblings ...)
  2016-12-28 14:32 ` [PATCH 4/6] drm: Export drm_ioctl_permit to kernel-doc Gabriel Krisman Bertazi
@ 2016-12-28 14:32 ` Gabriel Krisman Bertazi
  2016-12-30 11:43   ` Daniel Vetter
  2016-12-28 14:32 ` [PATCH 6/6] drm: Update TTM initialization documentation Gabriel Krisman Bertazi
  5 siblings, 1 reply; 16+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-12-28 14:32 UTC (permalink / raw)
  To: daniel.vetter; +Cc: Gabriel Krisman Bertazi, dri-devel

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 include/drm/drm_drv.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index c4fc49583dc0..0c8e4e979870 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -64,12 +64,42 @@ struct drm_mode_create_dumb;
  * structure for GEM drivers.
  */
 struct drm_driver {
+
+	/**
+	 * @load:
+	 *
+	 * Backward-compatible driver callback to complete
+	 * initialization steps after the driver is registered.  For
+	 * this reason, may suffer from race conditions and its use is
+	 * dicouraged for new drivers.  It is therefore only supported
+	 * for existing drivers not yet converted to the new scheme.
+	 *
+	 * Returns:
+	 * Zero on success, non-zero value on failure.
+	 */
 	int (*load) (struct drm_device *, unsigned long flags);
 	int (*firstopen) (struct drm_device *);
 	int (*open) (struct drm_device *, struct drm_file *);
 	void (*preclose) (struct drm_device *, struct drm_file *file_priv);
 	void (*postclose) (struct drm_device *, struct drm_file *);
 	void (*lastclose) (struct drm_device *);
+
+	/**
+	 * @unload:
+	 *
+	 * Reverse the effects of the driver load callback.  Ideally,
+	 * the clean up performed by the driver should happen in the
+	 * reverse order of the initialization.  Similarly to the load
+	 * hook, this handler is deprecated and its usage should be
+	 * dropped in favor of an open-coded teardown function at the
+	 * driver layer.
+	 *
+	 * The unload() hook is called immediately after unregistering
+	 * the device.
+	 *
+	 * Returns:
+	 * The return value is ignored.
+	 */
 	int (*unload) (struct drm_device *);
 	int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
 	int (*dma_quiescent) (struct drm_device *);
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 6/6] drm: Update TTM initialization documentation
  2016-12-28 14:32 [PATCH 0/6] drm documentation and clean ups Gabriel Krisman Bertazi
                   ` (4 preceding siblings ...)
  2016-12-28 14:32 ` [PATCH 5/6] drm: Document deprecated load/unload hook Gabriel Krisman Bertazi
@ 2016-12-28 14:32 ` Gabriel Krisman Bertazi
  2016-12-30 11:49   ` Daniel Vetter
  2016-12-30 11:53   ` Daniel Vetter
  5 siblings, 2 replies; 16+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-12-28 14:32 UTC (permalink / raw)
  To: daniel.vetter; +Cc: Gabriel Krisman Bertazi, dri-devel

ttm_global_reference was renamed to drm_global_reference.  This updates
the documentation to reflect that.  While we are there, document the
drm_global_reference API and update the initialization interface
documentation.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 Documentation/gpu/drm-mm.rst | 30 +++++++++++++++++-------------
 drivers/gpu/drm/drm_global.c | 23 +++++++++++++++++++++++
 2 files changed, 40 insertions(+), 13 deletions(-)

diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst
index cb5daffcd6be..3686ed148003 100644
--- a/Documentation/gpu/drm-mm.rst
+++ b/Documentation/gpu/drm-mm.rst
@@ -33,26 +33,24 @@ TTM design background and information belongs here.
 TTM initialization
 ------------------
 
-    **Warning**
+Drivers wishing to support TTM must pass a filled :c:type:`ttm_bo_driver
+<ttm_bo_driver>` structure to ttm_bo_device_init, together with an
+initialized global reference to the memory manager.  The ttm_bo_driver
+structure contains several fields with function pointers for
+initializing the TTM, allocating and freeing memory, waiting for command
+completion and fence synchronization, and memory migration.
 
-    This section is outdated.
-
-Drivers wishing to support TTM must fill out a drm_bo_driver
-structure. The structure contains several fields with function pointers
-for initializing the TTM, allocating and freeing memory, waiting for
-command completion and fence synchronization, and memory migration. See
-the radeon_ttm.c file for an example of usage.
-
-The ttm_global_reference structure is made up of several fields:
+The :c:type:`struct drm_global_reference <drm_global_reference>` is made
+up of several fields:
 
 .. code-block:: c
 
-              struct ttm_global_reference {
+              struct drm_global_reference {
                       enum ttm_global_types global_type;
                       size_t size;
                       void *object;
-                      int (*init) (struct ttm_global_reference *);
-                      void (*release) (struct ttm_global_reference *);
+                      int (*init) (struct drm_global_reference *);
+                      void (*release) (struct drm_global_reference *);
               };
 
 
@@ -76,6 +74,12 @@ ttm_bo_global_release(), respectively. Also, like the previous
 object, ttm_global_item_ref() is used to create an initial reference
 count for the TTM, which will call your initialization function.
 
+See the radeon_ttm.c file for an example of usage.
+
+.. kernel-doc:: drivers/gpu/drm/drm_global.c
+   :export:
+
+
 The Graphics Execution Manager (GEM)
 ====================================
 
diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c
index b404287abb97..b2dc21e33ae0 100644
--- a/drivers/gpu/drm/drm_global.c
+++ b/drivers/gpu/drm/drm_global.c
@@ -63,6 +63,18 @@ void drm_global_release(void)
 	}
 }
 
+/**
+ * drm_global_item_ref - Initialize and acquire reference to memory
+ * object
+ * @ref: Object for initialization
+ *
+ * This initializes a memory object, allocating memory and calling the
+ * .init() hook. Further calls will increase the reference count for
+ * that item.
+ *
+ * Returns:
+ * Zero on success, non-zero otherwise.
+ */
 int drm_global_item_ref(struct drm_global_reference *ref)
 {
 	int ret = 0;
@@ -97,6 +109,17 @@ int drm_global_item_ref(struct drm_global_reference *ref)
 }
 EXPORT_SYMBOL(drm_global_item_ref);
 
+/**
+ * drm_global_item_unref - Drop reference to memory
+ * object
+ * @ref: Object being removed
+ *
+ * Drop a reference to the memory object and eventually call the
+ * release() hook.  The allocated object should be dropped in the
+ * release() hook or before calling this function
+ *
+ */
+
 void drm_global_item_unref(struct drm_global_reference *ref)
 {
 	struct drm_global_item *item = &glob[ref->global_type];
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/6] drm: Deduplicate driver initialization message
  2016-12-28 14:32 ` [PATCH 1/6] drm: Deduplicate driver initialization message Gabriel Krisman Bertazi
@ 2016-12-30 11:38   ` Daniel Vetter
  2017-05-17 10:06     ` Jani Nikula
  0 siblings, 1 reply; 16+ messages in thread
From: Daniel Vetter @ 2016-12-30 11:38 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: daniel.vetter, dri-devel

On Wed, Dec 28, 2016 at 12:32:11PM -0200, Gabriel Krisman Bertazi wrote:
> Several DRM drivers print the same initialization message right after
> drm_dev_register, so move that to common code.  The exception is i915,
> which uses its own register handle, so let it keep its own message.
> 
> Notice that this was tested only with Exynos, but looks simple enough
> for the other drivers.
> 
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>

Makes sense, applied to drm-misc.

Thanks, Daniel

> ---
>  drivers/gpu/drm/armada/armada_drv.c             | 6 ------
>  drivers/gpu/drm/drm_drv.c                       | 7 +++++++
>  drivers/gpu/drm/drm_pci.c                       | 4 ----
>  drivers/gpu/drm/drm_platform.c                  | 4 ----
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 4 ----
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ----
>  drivers/gpu/drm/tegra/drm.c                     | 4 ----
>  drivers/gpu/drm/virtio/virtgpu_drm_bus.c        | 4 ----
>  8 files changed, 7 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
> index 07086b427c22..63f42d001f33 100644
> --- a/drivers/gpu/drm/armada/armada_drv.c
> +++ b/drivers/gpu/drm/armada/armada_drv.c
> @@ -203,12 +203,6 @@ static int armada_drm_bind(struct device *dev)
>  	armada_drm_debugfs_init(priv->drm.primary);
>  #endif
>  
> -	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
> -		 armada_drm_driver.name, armada_drm_driver.major,
> -		 armada_drm_driver.minor, armada_drm_driver.patchlevel,
> -		 armada_drm_driver.date, dev_name(dev),
> -		 priv->drm.primary->index);
> -
>  	return 0;
>  
>   err_poll:
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 4a7b3e98d586..d5aeba58c2ac 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -728,6 +728,7 @@ static void remove_compat_control_link(struct drm_device *dev)
>   */
>  int drm_dev_register(struct drm_device *dev, unsigned long flags)
>  {
> +	struct drm_driver *driver = dev->driver;
>  	int ret;
>  
>  	mutex_lock(&drm_global_mutex);
> @@ -758,6 +759,12 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
>  		drm_modeset_register_all(dev);
>  
>  	ret = 0;
> +
> +	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
> +		 driver->name, driver->major, driver->minor,
> +		 driver->patchlevel, driver->date, dev_name(dev->dev),
> +		 dev->primary->index);
> +
>  	goto out_unlock;
>  
>  err_minors:
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 3ceea9cb9d3e..dc358f860aea 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -257,10 +257,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
>  	if (ret)
>  		goto err_agp;
>  
> -	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
> -		 driver->date, pci_name(pdev), dev->primary->index);
> -
>  	/* No locking needed since shadow-attach is single-threaded since it may
>  	 * only be called from the per-driver module init hook. */
>  	if (drm_core_check_feature(dev, DRIVER_LEGACY))
> diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
> index 026269851ce9..7af3005a030c 100644
> --- a/drivers/gpu/drm/drm_platform.c
> +++ b/drivers/gpu/drm/drm_platform.c
> @@ -57,10 +57,6 @@ static int drm_get_platform_dev(struct platform_device *platdev,
>  	if (ret)
>  		goto err_free;
>  
> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
> -		 driver->date, dev->primary->index);
> -
>  	return 0;
>  
>  err_free:
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> index 0b35da73c2b0..9a31711d5158 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> @@ -415,10 +415,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
>  	if (ret < 0)
>  		goto unref;
>  
> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
> -		 driver->major, driver->minor, driver->patchlevel,
> -		 driver->date, drm->primary->index);
> -
>  	return 0;
>  
>  unref:
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index fa228b7b022c..7df0e8535e41 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -217,10 +217,6 @@ static int kirin_drm_bind(struct device *dev)
>  	if (ret)
>  		goto err_kms_cleanup;
>  
> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
> -		 driver->date, drm_dev->primary->index);
> -
>  	return 0;
>  
>  err_kms_cleanup:
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index e289dbc6ad82..1acf1da3f0df 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -992,10 +992,6 @@ static int host1x_drm_probe(struct host1x_device *dev)
>  	if (err < 0)
>  		goto unref;
>  
> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
> -		 driver->major, driver->minor, driver->patchlevel,
> -		 driver->date, drm->primary->index);
> -
>  	return 0;
>  
>  unref:
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> index 3b97d50fd392..43e1d5916c6c 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> @@ -83,10 +83,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
>  	if (ret)
>  		goto err_free;
>  
> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
> -		 driver->major, driver->minor, driver->patchlevel,
> -		 driver->date, dev->primary->index);
> -
>  	return 0;
>  
>  err_free:
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 5/6] drm: Document deprecated load/unload hook
  2016-12-28 14:32 ` [PATCH 5/6] drm: Document deprecated load/unload hook Gabriel Krisman Bertazi
@ 2016-12-30 11:43   ` Daniel Vetter
  0 siblings, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2016-12-30 11:43 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: daniel.vetter, dri-devel

On Wed, Dec 28, 2016 at 12:32:15PM -0200, Gabriel Krisman Bertazi wrote:
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> ---
>  include/drm/drm_drv.h | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index c4fc49583dc0..0c8e4e979870 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -64,12 +64,42 @@ struct drm_mode_create_dumb;
>   * structure for GEM drivers.
>   */
>  struct drm_driver {
> +
> +	/**
> +	 * @load:
> +	 *
> +	 * Backward-compatible driver callback to complete
> +	 * initialization steps after the driver is registered.  For
> +	 * this reason, may suffer from race conditions and its use is
> +	 * dicouraged for new drivers.  It is therefore only supported

s/discouraged/deprecated/ ... need some stronger wording here.

> +	 * for existing drivers not yet converted to the new scheme.

I think a link to the new scheme would be good, maybe:

"See drm_dev_init() and drm_dev_register() for proper and race-free way to
set up a &drm_device."

Unload is also deprecated, so similar comments apply for that.
-Daniel

> +	 *
> +	 * Returns:
> +	 * Zero on success, non-zero value on failure.
> +	 */
>  	int (*load) (struct drm_device *, unsigned long flags);
>  	int (*firstopen) (struct drm_device *);
>  	int (*open) (struct drm_device *, struct drm_file *);
>  	void (*preclose) (struct drm_device *, struct drm_file *file_priv);
>  	void (*postclose) (struct drm_device *, struct drm_file *);
>  	void (*lastclose) (struct drm_device *);
> +
> +	/**
> +	 * @unload:
> +	 *
> +	 * Reverse the effects of the driver load callback.  Ideally,
> +	 * the clean up performed by the driver should happen in the
> +	 * reverse order of the initialization.  Similarly to the load
> +	 * hook, this handler is deprecated and its usage should be
> +	 * dropped in favor of an open-coded teardown function at the
> +	 * driver layer.
> +	 *
> +	 * The unload() hook is called immediately after unregistering
> +	 * the device.
> +	 *
> +	 * Returns:
> +	 * The return value is ignored.
> +	 */
>  	int (*unload) (struct drm_device *);
>  	int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
>  	int (*dma_quiescent) (struct drm_device *);
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 6/6] drm: Update TTM initialization documentation
  2016-12-28 14:32 ` [PATCH 6/6] drm: Update TTM initialization documentation Gabriel Krisman Bertazi
@ 2016-12-30 11:49   ` Daniel Vetter
  2016-12-30 11:53   ` Daniel Vetter
  1 sibling, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2016-12-30 11:49 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: daniel.vetter, dri-devel

On Wed, Dec 28, 2016 at 12:32:16PM -0200, Gabriel Krisman Bertazi wrote:
> ttm_global_reference was renamed to drm_global_reference.  This updates
> the documentation to reflect that.  While we are there, document the
> drm_global_reference API and update the initialization interface
> documentation.
> 
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>

Also merged patches 3,5&6.

Thanks, Daniel

> ---
>  Documentation/gpu/drm-mm.rst | 30 +++++++++++++++++-------------
>  drivers/gpu/drm/drm_global.c | 23 +++++++++++++++++++++++
>  2 files changed, 40 insertions(+), 13 deletions(-)
> 
> diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst
> index cb5daffcd6be..3686ed148003 100644
> --- a/Documentation/gpu/drm-mm.rst
> +++ b/Documentation/gpu/drm-mm.rst
> @@ -33,26 +33,24 @@ TTM design background and information belongs here.
>  TTM initialization
>  ------------------
>  
> -    **Warning**
> +Drivers wishing to support TTM must pass a filled :c:type:`ttm_bo_driver
> +<ttm_bo_driver>` structure to ttm_bo_device_init, together with an
> +initialized global reference to the memory manager.  The ttm_bo_driver
> +structure contains several fields with function pointers for
> +initializing the TTM, allocating and freeing memory, waiting for command
> +completion and fence synchronization, and memory migration.
>  
> -    This section is outdated.
> -
> -Drivers wishing to support TTM must fill out a drm_bo_driver
> -structure. The structure contains several fields with function pointers
> -for initializing the TTM, allocating and freeing memory, waiting for
> -command completion and fence synchronization, and memory migration. See
> -the radeon_ttm.c file for an example of usage.
> -
> -The ttm_global_reference structure is made up of several fields:
> +The :c:type:`struct drm_global_reference <drm_global_reference>` is made
> +up of several fields:
>  
>  .. code-block:: c
>  
> -              struct ttm_global_reference {
> +              struct drm_global_reference {
>                        enum ttm_global_types global_type;
>                        size_t size;
>                        void *object;
> -                      int (*init) (struct ttm_global_reference *);
> -                      void (*release) (struct ttm_global_reference *);
> +                      int (*init) (struct drm_global_reference *);
> +                      void (*release) (struct drm_global_reference *);
>                };
>  
>  
> @@ -76,6 +74,12 @@ ttm_bo_global_release(), respectively. Also, like the previous
>  object, ttm_global_item_ref() is used to create an initial reference
>  count for the TTM, which will call your initialization function.
>  
> +See the radeon_ttm.c file for an example of usage.
> +
> +.. kernel-doc:: drivers/gpu/drm/drm_global.c
> +   :export:
> +
> +
>  The Graphics Execution Manager (GEM)
>  ====================================
>  
> diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c
> index b404287abb97..b2dc21e33ae0 100644
> --- a/drivers/gpu/drm/drm_global.c
> +++ b/drivers/gpu/drm/drm_global.c
> @@ -63,6 +63,18 @@ void drm_global_release(void)
>  	}
>  }
>  
> +/**
> + * drm_global_item_ref - Initialize and acquire reference to memory
> + * object
> + * @ref: Object for initialization
> + *
> + * This initializes a memory object, allocating memory and calling the
> + * .init() hook. Further calls will increase the reference count for
> + * that item.
> + *
> + * Returns:
> + * Zero on success, non-zero otherwise.
> + */
>  int drm_global_item_ref(struct drm_global_reference *ref)
>  {
>  	int ret = 0;
> @@ -97,6 +109,17 @@ int drm_global_item_ref(struct drm_global_reference *ref)
>  }
>  EXPORT_SYMBOL(drm_global_item_ref);
>  
> +/**
> + * drm_global_item_unref - Drop reference to memory
> + * object
> + * @ref: Object being removed
> + *
> + * Drop a reference to the memory object and eventually call the
> + * release() hook.  The allocated object should be dropped in the
> + * release() hook or before calling this function
> + *
> + */
> +
>  void drm_global_item_unref(struct drm_global_reference *ref)
>  {
>  	struct drm_global_item *item = &glob[ref->global_type];
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 6/6] drm: Update TTM initialization documentation
  2016-12-28 14:32 ` [PATCH 6/6] drm: Update TTM initialization documentation Gabriel Krisman Bertazi
  2016-12-30 11:49   ` Daniel Vetter
@ 2016-12-30 11:53   ` Daniel Vetter
  1 sibling, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2016-12-30 11:53 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: daniel.vetter, dri-devel

On Wed, Dec 28, 2016 at 12:32:16PM -0200, Gabriel Krisman Bertazi wrote:
> ttm_global_reference was renamed to drm_global_reference.  This updates
> the documentation to reflect that.  While we are there, document the
> drm_global_reference API and update the initialization interface
> documentation.
> 
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> ---
>  Documentation/gpu/drm-mm.rst | 30 +++++++++++++++++-------------
>  drivers/gpu/drm/drm_global.c | 23 +++++++++++++++++++++++
>  2 files changed, 40 insertions(+), 13 deletions(-)
> 
> diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst
> index cb5daffcd6be..3686ed148003 100644
> --- a/Documentation/gpu/drm-mm.rst
> +++ b/Documentation/gpu/drm-mm.rst
> @@ -33,26 +33,24 @@ TTM design background and information belongs here.
>  TTM initialization
>  ------------------
>  
> -    **Warning**
> +Drivers wishing to support TTM must pass a filled :c:type:`ttm_bo_driver
> +<ttm_bo_driver>` structure to ttm_bo_device_init, together with an
> +initialized global reference to the memory manager.  The ttm_bo_driver
> +structure contains several fields with function pointers for
> +initializing the TTM, allocating and freeing memory, waiting for command
> +completion and fence synchronization, and memory migration.
>  
> -    This section is outdated.

Forgot to mention: I kept this warning, since TTM docs are still massively
inadequate.
-Daniel

> -
> -Drivers wishing to support TTM must fill out a drm_bo_driver
> -structure. The structure contains several fields with function pointers
> -for initializing the TTM, allocating and freeing memory, waiting for
> -command completion and fence synchronization, and memory migration. See
> -the radeon_ttm.c file for an example of usage.
> -
> -The ttm_global_reference structure is made up of several fields:
> +The :c:type:`struct drm_global_reference <drm_global_reference>` is made
> +up of several fields:
>  
>  .. code-block:: c
>  
> -              struct ttm_global_reference {
> +              struct drm_global_reference {
>                        enum ttm_global_types global_type;
>                        size_t size;
>                        void *object;
> -                      int (*init) (struct ttm_global_reference *);
> -                      void (*release) (struct ttm_global_reference *);
> +                      int (*init) (struct drm_global_reference *);
> +                      void (*release) (struct drm_global_reference *);
>                };
>  
>  
> @@ -76,6 +74,12 @@ ttm_bo_global_release(), respectively. Also, like the previous
>  object, ttm_global_item_ref() is used to create an initial reference
>  count for the TTM, which will call your initialization function.
>  
> +See the radeon_ttm.c file for an example of usage.
> +
> +.. kernel-doc:: drivers/gpu/drm/drm_global.c
> +   :export:
> +
> +
>  The Graphics Execution Manager (GEM)
>  ====================================
>  
> diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c
> index b404287abb97..b2dc21e33ae0 100644
> --- a/drivers/gpu/drm/drm_global.c
> +++ b/drivers/gpu/drm/drm_global.c
> @@ -63,6 +63,18 @@ void drm_global_release(void)
>  	}
>  }
>  
> +/**
> + * drm_global_item_ref - Initialize and acquire reference to memory
> + * object
> + * @ref: Object for initialization
> + *
> + * This initializes a memory object, allocating memory and calling the
> + * .init() hook. Further calls will increase the reference count for
> + * that item.
> + *
> + * Returns:
> + * Zero on success, non-zero otherwise.
> + */
>  int drm_global_item_ref(struct drm_global_reference *ref)
>  {
>  	int ret = 0;
> @@ -97,6 +109,17 @@ int drm_global_item_ref(struct drm_global_reference *ref)
>  }
>  EXPORT_SYMBOL(drm_global_item_ref);
>  
> +/**
> + * drm_global_item_unref - Drop reference to memory
> + * object
> + * @ref: Object being removed
> + *
> + * Drop a reference to the memory object and eventually call the
> + * release() hook.  The allocated object should be dropped in the
> + * release() hook or before calling this function
> + *
> + */
> +
>  void drm_global_item_unref(struct drm_global_reference *ref)
>  {
>  	struct drm_global_item *item = &glob[ref->global_type];
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/6] drm: Deduplicate driver initialization message
  2016-12-30 11:38   ` Daniel Vetter
@ 2017-05-17 10:06     ` Jani Nikula
  2017-05-17 11:41       ` Daniel Vetter
  0 siblings, 1 reply; 16+ messages in thread
From: Jani Nikula @ 2017-05-17 10:06 UTC (permalink / raw)
  To: Daniel Vetter, Gabriel Krisman Bertazi; +Cc: daniel.vetter, dri-devel

On Fri, 30 Dec 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Dec 28, 2016 at 12:32:11PM -0200, Gabriel Krisman Bertazi wrote:
>> Several DRM drivers print the same initialization message right after
>> drm_dev_register, so move that to common code.  The exception is i915,
>> which uses its own register handle, so let it keep its own message.
>> 
>> Notice that this was tested only with Exynos, but looks simple enough
>> for the other drivers.
>> 
>> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
>
> Makes sense, applied to drm-misc.

Makes sense for everything except i915:

https://bugs.freedesktop.org/show_bug.cgi?id=101025

BR,
Jani.


>
> Thanks, Daniel
>
>> ---
>>  drivers/gpu/drm/armada/armada_drv.c             | 6 ------
>>  drivers/gpu/drm/drm_drv.c                       | 7 +++++++
>>  drivers/gpu/drm/drm_pci.c                       | 4 ----
>>  drivers/gpu/drm/drm_platform.c                  | 4 ----
>>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 4 ----
>>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ----
>>  drivers/gpu/drm/tegra/drm.c                     | 4 ----
>>  drivers/gpu/drm/virtio/virtgpu_drm_bus.c        | 4 ----
>>  8 files changed, 7 insertions(+), 30 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
>> index 07086b427c22..63f42d001f33 100644
>> --- a/drivers/gpu/drm/armada/armada_drv.c
>> +++ b/drivers/gpu/drm/armada/armada_drv.c
>> @@ -203,12 +203,6 @@ static int armada_drm_bind(struct device *dev)
>>  	armada_drm_debugfs_init(priv->drm.primary);
>>  #endif
>>  
>> -	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
>> -		 armada_drm_driver.name, armada_drm_driver.major,
>> -		 armada_drm_driver.minor, armada_drm_driver.patchlevel,
>> -		 armada_drm_driver.date, dev_name(dev),
>> -		 priv->drm.primary->index);
>> -
>>  	return 0;
>>  
>>   err_poll:
>> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
>> index 4a7b3e98d586..d5aeba58c2ac 100644
>> --- a/drivers/gpu/drm/drm_drv.c
>> +++ b/drivers/gpu/drm/drm_drv.c
>> @@ -728,6 +728,7 @@ static void remove_compat_control_link(struct drm_device *dev)
>>   */
>>  int drm_dev_register(struct drm_device *dev, unsigned long flags)
>>  {
>> +	struct drm_driver *driver = dev->driver;
>>  	int ret;
>>  
>>  	mutex_lock(&drm_global_mutex);
>> @@ -758,6 +759,12 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
>>  		drm_modeset_register_all(dev);
>>  
>>  	ret = 0;
>> +
>> +	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
>> +		 driver->name, driver->major, driver->minor,
>> +		 driver->patchlevel, driver->date, dev_name(dev->dev),
>> +		 dev->primary->index);
>> +
>>  	goto out_unlock;
>>  
>>  err_minors:
>> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
>> index 3ceea9cb9d3e..dc358f860aea 100644
>> --- a/drivers/gpu/drm/drm_pci.c
>> +++ b/drivers/gpu/drm/drm_pci.c
>> @@ -257,10 +257,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
>>  	if (ret)
>>  		goto err_agp;
>>  
>> -	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
>> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
>> -		 driver->date, pci_name(pdev), dev->primary->index);
>> -
>>  	/* No locking needed since shadow-attach is single-threaded since it may
>>  	 * only be called from the per-driver module init hook. */
>>  	if (drm_core_check_feature(dev, DRIVER_LEGACY))
>> diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
>> index 026269851ce9..7af3005a030c 100644
>> --- a/drivers/gpu/drm/drm_platform.c
>> +++ b/drivers/gpu/drm/drm_platform.c
>> @@ -57,10 +57,6 @@ static int drm_get_platform_dev(struct platform_device *platdev,
>>  	if (ret)
>>  		goto err_free;
>>  
>> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
>> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
>> -		 driver->date, dev->primary->index);
>> -
>>  	return 0;
>>  
>>  err_free:
>> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
>> index 0b35da73c2b0..9a31711d5158 100644
>> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
>> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
>> @@ -415,10 +415,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
>>  	if (ret < 0)
>>  		goto unref;
>>  
>> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
>> -		 driver->major, driver->minor, driver->patchlevel,
>> -		 driver->date, drm->primary->index);
>> -
>>  	return 0;
>>  
>>  unref:
>> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
>> index fa228b7b022c..7df0e8535e41 100644
>> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
>> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
>> @@ -217,10 +217,6 @@ static int kirin_drm_bind(struct device *dev)
>>  	if (ret)
>>  		goto err_kms_cleanup;
>>  
>> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
>> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
>> -		 driver->date, drm_dev->primary->index);
>> -
>>  	return 0;
>>  
>>  err_kms_cleanup:
>> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
>> index e289dbc6ad82..1acf1da3f0df 100644
>> --- a/drivers/gpu/drm/tegra/drm.c
>> +++ b/drivers/gpu/drm/tegra/drm.c
>> @@ -992,10 +992,6 @@ static int host1x_drm_probe(struct host1x_device *dev)
>>  	if (err < 0)
>>  		goto unref;
>>  
>> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
>> -		 driver->major, driver->minor, driver->patchlevel,
>> -		 driver->date, drm->primary->index);
>> -
>>  	return 0;
>>  
>>  unref:
>> diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
>> index 3b97d50fd392..43e1d5916c6c 100644
>> --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
>> +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
>> @@ -83,10 +83,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
>>  	if (ret)
>>  		goto err_free;
>>  
>> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
>> -		 driver->major, driver->minor, driver->patchlevel,
>> -		 driver->date, dev->primary->index);
>> -
>>  	return 0;
>>  
>>  err_free:
>> -- 
>> 2.11.0
>> 
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/6] drm: Deduplicate driver initialization message
  2017-05-17 10:06     ` Jani Nikula
@ 2017-05-17 11:41       ` Daniel Vetter
  2017-05-17 11:51         ` Jani Nikula
  0 siblings, 1 reply; 16+ messages in thread
From: Daniel Vetter @ 2017-05-17 11:41 UTC (permalink / raw)
  To: Jani Nikula; +Cc: daniel.vetter, dri-devel, Gabriel Krisman Bertazi

On Wed, May 17, 2017 at 01:06:46PM +0300, Jani Nikula wrote:
> On Fri, 30 Dec 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Wed, Dec 28, 2016 at 12:32:11PM -0200, Gabriel Krisman Bertazi wrote:
> >> Several DRM drivers print the same initialization message right after
> >> drm_dev_register, so move that to common code.  The exception is i915,
> >> which uses its own register handle, so let it keep its own message.
> >> 
> >> Notice that this was tested only with Exynos, but looks simple enough
> >> for the other drivers.
> >> 
> >> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> >
> > Makes sense, applied to drm-misc.
> 
> Makes sense for everything except i915:
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=101025

Not sure how this happened, the i915 patch landed a few months earlier:

commit bc5ca47c0af4f949ba889e666b7da65569e36093
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 25 08:23:14 2016 +0100

    drm/i915: Restore lost "Initialized i915" welcome message

Gabriel, can you pls follow up with a patch to address this?

Thanks, Daniel

> 
> BR,
> Jani.
> 
> 
> >
> > Thanks, Daniel
> >
> >> ---
> >>  drivers/gpu/drm/armada/armada_drv.c             | 6 ------
> >>  drivers/gpu/drm/drm_drv.c                       | 7 +++++++
> >>  drivers/gpu/drm/drm_pci.c                       | 4 ----
> >>  drivers/gpu/drm/drm_platform.c                  | 4 ----
> >>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 4 ----
> >>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ----
> >>  drivers/gpu/drm/tegra/drm.c                     | 4 ----
> >>  drivers/gpu/drm/virtio/virtgpu_drm_bus.c        | 4 ----
> >>  8 files changed, 7 insertions(+), 30 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
> >> index 07086b427c22..63f42d001f33 100644
> >> --- a/drivers/gpu/drm/armada/armada_drv.c
> >> +++ b/drivers/gpu/drm/armada/armada_drv.c
> >> @@ -203,12 +203,6 @@ static int armada_drm_bind(struct device *dev)
> >>  	armada_drm_debugfs_init(priv->drm.primary);
> >>  #endif
> >>  
> >> -	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
> >> -		 armada_drm_driver.name, armada_drm_driver.major,
> >> -		 armada_drm_driver.minor, armada_drm_driver.patchlevel,
> >> -		 armada_drm_driver.date, dev_name(dev),
> >> -		 priv->drm.primary->index);
> >> -
> >>  	return 0;
> >>  
> >>   err_poll:
> >> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> >> index 4a7b3e98d586..d5aeba58c2ac 100644
> >> --- a/drivers/gpu/drm/drm_drv.c
> >> +++ b/drivers/gpu/drm/drm_drv.c
> >> @@ -728,6 +728,7 @@ static void remove_compat_control_link(struct drm_device *dev)
> >>   */
> >>  int drm_dev_register(struct drm_device *dev, unsigned long flags)
> >>  {
> >> +	struct drm_driver *driver = dev->driver;
> >>  	int ret;
> >>  
> >>  	mutex_lock(&drm_global_mutex);
> >> @@ -758,6 +759,12 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
> >>  		drm_modeset_register_all(dev);
> >>  
> >>  	ret = 0;
> >> +
> >> +	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
> >> +		 driver->name, driver->major, driver->minor,
> >> +		 driver->patchlevel, driver->date, dev_name(dev->dev),
> >> +		 dev->primary->index);
> >> +
> >>  	goto out_unlock;
> >>  
> >>  err_minors:
> >> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> >> index 3ceea9cb9d3e..dc358f860aea 100644
> >> --- a/drivers/gpu/drm/drm_pci.c
> >> +++ b/drivers/gpu/drm/drm_pci.c
> >> @@ -257,10 +257,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
> >>  	if (ret)
> >>  		goto err_agp;
> >>  
> >> -	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
> >> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
> >> -		 driver->date, pci_name(pdev), dev->primary->index);
> >> -
> >>  	/* No locking needed since shadow-attach is single-threaded since it may
> >>  	 * only be called from the per-driver module init hook. */
> >>  	if (drm_core_check_feature(dev, DRIVER_LEGACY))
> >> diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
> >> index 026269851ce9..7af3005a030c 100644
> >> --- a/drivers/gpu/drm/drm_platform.c
> >> +++ b/drivers/gpu/drm/drm_platform.c
> >> @@ -57,10 +57,6 @@ static int drm_get_platform_dev(struct platform_device *platdev,
> >>  	if (ret)
> >>  		goto err_free;
> >>  
> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
> >> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
> >> -		 driver->date, dev->primary->index);
> >> -
> >>  	return 0;
> >>  
> >>  err_free:
> >> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> >> index 0b35da73c2b0..9a31711d5158 100644
> >> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> >> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> >> @@ -415,10 +415,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
> >>  	if (ret < 0)
> >>  		goto unref;
> >>  
> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
> >> -		 driver->major, driver->minor, driver->patchlevel,
> >> -		 driver->date, drm->primary->index);
> >> -
> >>  	return 0;
> >>  
> >>  unref:
> >> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> >> index fa228b7b022c..7df0e8535e41 100644
> >> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> >> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> >> @@ -217,10 +217,6 @@ static int kirin_drm_bind(struct device *dev)
> >>  	if (ret)
> >>  		goto err_kms_cleanup;
> >>  
> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
> >> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
> >> -		 driver->date, drm_dev->primary->index);
> >> -
> >>  	return 0;
> >>  
> >>  err_kms_cleanup:
> >> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> >> index e289dbc6ad82..1acf1da3f0df 100644
> >> --- a/drivers/gpu/drm/tegra/drm.c
> >> +++ b/drivers/gpu/drm/tegra/drm.c
> >> @@ -992,10 +992,6 @@ static int host1x_drm_probe(struct host1x_device *dev)
> >>  	if (err < 0)
> >>  		goto unref;
> >>  
> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
> >> -		 driver->major, driver->minor, driver->patchlevel,
> >> -		 driver->date, drm->primary->index);
> >> -
> >>  	return 0;
> >>  
> >>  unref:
> >> diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> >> index 3b97d50fd392..43e1d5916c6c 100644
> >> --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> >> +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> >> @@ -83,10 +83,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
> >>  	if (ret)
> >>  		goto err_free;
> >>  
> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
> >> -		 driver->major, driver->minor, driver->patchlevel,
> >> -		 driver->date, dev->primary->index);
> >> -
> >>  	return 0;
> >>  
> >>  err_free:
> >> -- 
> >> 2.11.0
> >> 
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/6] drm: Deduplicate driver initialization message
  2017-05-17 11:41       ` Daniel Vetter
@ 2017-05-17 11:51         ` Jani Nikula
  0 siblings, 0 replies; 16+ messages in thread
From: Jani Nikula @ 2017-05-17 11:51 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: daniel.vetter, dri-devel, Gabriel Krisman Bertazi

On Wed, 17 May 2017, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, May 17, 2017 at 01:06:46PM +0300, Jani Nikula wrote:
>> On Fri, 30 Dec 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
>> > On Wed, Dec 28, 2016 at 12:32:11PM -0200, Gabriel Krisman Bertazi wrote:
>> >> Several DRM drivers print the same initialization message right after
>> >> drm_dev_register, so move that to common code.  The exception is i915,
>> >> which uses its own register handle, so let it keep its own message.
>> >> 
>> >> Notice that this was tested only with Exynos, but looks simple enough
>> >> for the other drivers.
>> >> 
>> >> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
>> >
>> > Makes sense, applied to drm-misc.
>> 
>> Makes sense for everything except i915:
>> 
>> https://bugs.freedesktop.org/show_bug.cgi?id=101025
>
> Not sure how this happened, the i915 patch landed a few months earlier:
>
> commit bc5ca47c0af4f949ba889e666b7da65569e36093
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Thu Aug 25 08:23:14 2016 +0100
>
>     drm/i915: Restore lost "Initialized i915" welcome message
>
> Gabriel, can you pls follow up with a patch to address this?

Isn't the fix then to revert that? Since the message now comes from
core?

BR,
Jani.

>
> Thanks, Daniel
>
>> 
>> BR,
>> Jani.
>> 
>> 
>> >
>> > Thanks, Daniel
>> >
>> >> ---
>> >>  drivers/gpu/drm/armada/armada_drv.c             | 6 ------
>> >>  drivers/gpu/drm/drm_drv.c                       | 7 +++++++
>> >>  drivers/gpu/drm/drm_pci.c                       | 4 ----
>> >>  drivers/gpu/drm/drm_platform.c                  | 4 ----
>> >>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 4 ----
>> >>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ----
>> >>  drivers/gpu/drm/tegra/drm.c                     | 4 ----
>> >>  drivers/gpu/drm/virtio/virtgpu_drm_bus.c        | 4 ----
>> >>  8 files changed, 7 insertions(+), 30 deletions(-)
>> >> 
>> >> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
>> >> index 07086b427c22..63f42d001f33 100644
>> >> --- a/drivers/gpu/drm/armada/armada_drv.c
>> >> +++ b/drivers/gpu/drm/armada/armada_drv.c
>> >> @@ -203,12 +203,6 @@ static int armada_drm_bind(struct device *dev)
>> >>  	armada_drm_debugfs_init(priv->drm.primary);
>> >>  #endif
>> >>  
>> >> -	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
>> >> -		 armada_drm_driver.name, armada_drm_driver.major,
>> >> -		 armada_drm_driver.minor, armada_drm_driver.patchlevel,
>> >> -		 armada_drm_driver.date, dev_name(dev),
>> >> -		 priv->drm.primary->index);
>> >> -
>> >>  	return 0;
>> >>  
>> >>   err_poll:
>> >> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
>> >> index 4a7b3e98d586..d5aeba58c2ac 100644
>> >> --- a/drivers/gpu/drm/drm_drv.c
>> >> +++ b/drivers/gpu/drm/drm_drv.c
>> >> @@ -728,6 +728,7 @@ static void remove_compat_control_link(struct drm_device *dev)
>> >>   */
>> >>  int drm_dev_register(struct drm_device *dev, unsigned long flags)
>> >>  {
>> >> +	struct drm_driver *driver = dev->driver;
>> >>  	int ret;
>> >>  
>> >>  	mutex_lock(&drm_global_mutex);
>> >> @@ -758,6 +759,12 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
>> >>  		drm_modeset_register_all(dev);
>> >>  
>> >>  	ret = 0;
>> >> +
>> >> +	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
>> >> +		 driver->name, driver->major, driver->minor,
>> >> +		 driver->patchlevel, driver->date, dev_name(dev->dev),
>> >> +		 dev->primary->index);
>> >> +
>> >>  	goto out_unlock;
>> >>  
>> >>  err_minors:
>> >> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
>> >> index 3ceea9cb9d3e..dc358f860aea 100644
>> >> --- a/drivers/gpu/drm/drm_pci.c
>> >> +++ b/drivers/gpu/drm/drm_pci.c
>> >> @@ -257,10 +257,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
>> >>  	if (ret)
>> >>  		goto err_agp;
>> >>  
>> >> -	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
>> >> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
>> >> -		 driver->date, pci_name(pdev), dev->primary->index);
>> >> -
>> >>  	/* No locking needed since shadow-attach is single-threaded since it may
>> >>  	 * only be called from the per-driver module init hook. */
>> >>  	if (drm_core_check_feature(dev, DRIVER_LEGACY))
>> >> diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
>> >> index 026269851ce9..7af3005a030c 100644
>> >> --- a/drivers/gpu/drm/drm_platform.c
>> >> +++ b/drivers/gpu/drm/drm_platform.c
>> >> @@ -57,10 +57,6 @@ static int drm_get_platform_dev(struct platform_device *platdev,
>> >>  	if (ret)
>> >>  		goto err_free;
>> >>  
>> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
>> >> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
>> >> -		 driver->date, dev->primary->index);
>> >> -
>> >>  	return 0;
>> >>  
>> >>  err_free:
>> >> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
>> >> index 0b35da73c2b0..9a31711d5158 100644
>> >> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
>> >> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
>> >> @@ -415,10 +415,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
>> >>  	if (ret < 0)
>> >>  		goto unref;
>> >>  
>> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
>> >> -		 driver->major, driver->minor, driver->patchlevel,
>> >> -		 driver->date, drm->primary->index);
>> >> -
>> >>  	return 0;
>> >>  
>> >>  unref:
>> >> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
>> >> index fa228b7b022c..7df0e8535e41 100644
>> >> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
>> >> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
>> >> @@ -217,10 +217,6 @@ static int kirin_drm_bind(struct device *dev)
>> >>  	if (ret)
>> >>  		goto err_kms_cleanup;
>> >>  
>> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
>> >> -		 driver->name, driver->major, driver->minor, driver->patchlevel,
>> >> -		 driver->date, drm_dev->primary->index);
>> >> -
>> >>  	return 0;
>> >>  
>> >>  err_kms_cleanup:
>> >> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
>> >> index e289dbc6ad82..1acf1da3f0df 100644
>> >> --- a/drivers/gpu/drm/tegra/drm.c
>> >> +++ b/drivers/gpu/drm/tegra/drm.c
>> >> @@ -992,10 +992,6 @@ static int host1x_drm_probe(struct host1x_device *dev)
>> >>  	if (err < 0)
>> >>  		goto unref;
>> >>  
>> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
>> >> -		 driver->major, driver->minor, driver->patchlevel,
>> >> -		 driver->date, drm->primary->index);
>> >> -
>> >>  	return 0;
>> >>  
>> >>  unref:
>> >> diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
>> >> index 3b97d50fd392..43e1d5916c6c 100644
>> >> --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
>> >> +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
>> >> @@ -83,10 +83,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
>> >>  	if (ret)
>> >>  		goto err_free;
>> >>  
>> >> -	DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
>> >> -		 driver->major, driver->minor, driver->patchlevel,
>> >> -		 driver->date, dev->primary->index);
>> >> -
>> >>  	return 0;
>> >>  
>> >>  err_free:
>> >> -- 
>> >> 2.11.0
>> >> 
>> >> _______________________________________________
>> >> dri-devel mailing list
>> >> dri-devel@lists.freedesktop.org
>> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>> 
>> -- 
>> Jani Nikula, Intel Open Source Technology Center

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/6] exynos_drm: Clean up duplicated assignment in exynos_drm_driver
  2016-12-28 14:32 ` [PATCH 2/6] exynos_drm: Clean up duplicated assignment in exynos_drm_driver Gabriel Krisman Bertazi
@ 2017-06-19 11:03   ` Andrzej Hajda
  2017-06-21  4:58     ` Inki Dae
  0 siblings, 1 reply; 16+ messages in thread
From: Andrzej Hajda @ 2017-06-19 11:03 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi, daniel.vetter; +Cc: dri-devel

Hi Inki,

On 28.12.2016 15:32, Gabriel Krisman Bertazi wrote:
> num_ioctls is already assigned when declaring the exynos_drm_driver
> structure.  No need to duplicate it here.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>

It looks like the patch has not been merged, probably due to lack of
your e-mail.
Anyway it does the right thing, could you take it?

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

 --
Regards
Andrzej

> ---
>  drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index 739180ac3da5..44b4d07eefb5 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -570,7 +570,6 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
>  	struct component_match *match;
>  
>  	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> -	exynos_drm_driver.num_ioctls = ARRAY_SIZE(exynos_ioctls);
>  
>  	match = exynos_drm_match_add(&pdev->dev);
>  	if (IS_ERR(match))


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/6] exynos_drm: Clean up duplicated assignment in exynos_drm_driver
  2017-06-19 11:03   ` Andrzej Hajda
@ 2017-06-21  4:58     ` Inki Dae
  0 siblings, 0 replies; 16+ messages in thread
From: Inki Dae @ 2017-06-21  4:58 UTC (permalink / raw)
  To: Andrzej Hajda, Gabriel Krisman Bertazi, daniel.vetter; +Cc: dri-devel

Hi Andrzej,

2017년 06월 19일 20:03에 Andrzej Hajda 이(가) 쓴 글:
> Hi Inki,
> 
> On 28.12.2016 15:32, Gabriel Krisman Bertazi wrote:
>> num_ioctls is already assigned when declaring the exynos_drm_driver
>> structure.  No need to duplicate it here.
>>
>> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> 
> It looks like the patch has not been merged, probably due to lack of
> your e-mail.
> Anyway it does the right thing, could you take it?

Got it. Thanks for notice.

Thanks,
Inki Dae

> 
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> 
>  --
> Regards
> Andrzej
> 
>> ---
>>  drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
>> index 739180ac3da5..44b4d07eefb5 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
>> @@ -570,7 +570,6 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
>>  	struct component_match *match;
>>  
>>  	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
>> -	exynos_drm_driver.num_ioctls = ARRAY_SIZE(exynos_ioctls);
>>  
>>  	match = exynos_drm_match_add(&pdev->dev);
>>  	if (IS_ERR(match))
> 
> 
> 
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-06-21  5:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-28 14:32 [PATCH 0/6] drm documentation and clean ups Gabriel Krisman Bertazi
2016-12-28 14:32 ` [PATCH 1/6] drm: Deduplicate driver initialization message Gabriel Krisman Bertazi
2016-12-30 11:38   ` Daniel Vetter
2017-05-17 10:06     ` Jani Nikula
2017-05-17 11:41       ` Daniel Vetter
2017-05-17 11:51         ` Jani Nikula
2016-12-28 14:32 ` [PATCH 2/6] exynos_drm: Clean up duplicated assignment in exynos_drm_driver Gabriel Krisman Bertazi
2017-06-19 11:03   ` Andrzej Hajda
2017-06-21  4:58     ` Inki Dae
2016-12-28 14:32 ` [PATCH 3/6] drm: Drop unused forward declaration of drm_version Gabriel Krisman Bertazi
2016-12-28 14:32 ` [PATCH 4/6] drm: Export drm_ioctl_permit to kernel-doc Gabriel Krisman Bertazi
2016-12-28 14:32 ` [PATCH 5/6] drm: Document deprecated load/unload hook Gabriel Krisman Bertazi
2016-12-30 11:43   ` Daniel Vetter
2016-12-28 14:32 ` [PATCH 6/6] drm: Update TTM initialization documentation Gabriel Krisman Bertazi
2016-12-30 11:49   ` Daniel Vetter
2016-12-30 11:53   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.