[openchrome-devel] drm-openchrome: Branch 'drm-next-6.7' - 11 commits - drivers/gpu/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Fri Sep 29 21:57:38 UTC 2023


 drivers/gpu/drm/via/via_drv.c    |   20 +-
 drivers/gpu/drm/via/via_drv.h    |    4 
 drivers/gpu/drm/via/via_init.c   |  349 ++++++++++++++++++---------------------
 drivers/gpu/drm/via/via_ioctl.c  |    8 
 drivers/gpu/drm/via/via_object.c |   41 ++--
 drivers/gpu/drm/via/via_pm.c     |    8 
 drivers/gpu/drm/via/via_ttm.c    |   16 -
 7 files changed, 219 insertions(+), 227 deletions(-)

New commits:
commit 885ceb7b80f7c60dd330eca2cdd0030e392a6528
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Sep 29 14:54:29 2023 -0700

    drm/via: Version bumped to 3.6.12
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index b7a273d614da..3feea09c830b 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR		3
 #define DRIVER_MINOR		6
-#define DRIVER_PATCHLEVEL	11
+#define DRIVER_PATCHLEVEL	12
 #define DRIVER_NAME		"via"
 #define DRIVER_DESC		"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE		"20230909"
+#define DRIVER_DATE		"20230929"
 #define DRIVER_AUTHOR		"OpenChrome Project"
 
 
commit 44744ad966200442a83ce3d52834fdbe75a8d203
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Sep 29 14:54:27 2023 -0700

    drm/via: Improve the error handling of via_drm_init()
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 330738dacd8c..661bf6e199fc 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1310,28 +1310,28 @@ int via_drm_init(struct drm_device *dev)
 
 	ret = via_device_init(dev);
 	if (ret) {
-		drm_err(dev, "Failed to initialize Chrome IGP.\n");
+		drm_err(dev, "Failed to initialize Chrome IGP!\n");
 		goto exit;
 	}
 
 	ret = via_mm_init(dev);
 	if (ret) {
-		drm_err(dev, "Failed to initialize TTM.\n");
-		goto exit;
+		drm_err(dev, "Failed to initialize TTM!\n");
+		goto error_mm_init;
 	}
 
 	via_chip_revision_info(dev);
 
 	ret = via_modeset_init(dev);
 	if (ret) {
-		drm_err(dev, "Failed to initialize mode setting.\n");
-		goto error_modeset;
+		drm_err(dev, "Failed to initialize mode setting!\n");
+		goto error_modeset_init;
 	}
 
 	goto exit;
-error_modeset:
-	via_modeset_fini(dev);
+error_modeset_init:
 	via_mm_fini(dev);
+error_mm_init:
 	via_device_fini(dev);
 exit:
 	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
commit 2bff347ccb0f020f05faa2c200976bbf2a40f3ac
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Sep 29 14:54:26 2023 -0700

    drm/via: Improve the error handling of via_modeset_init()
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 9a3340b42f7c..330738dacd8c 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1255,7 +1255,8 @@ int via_modeset_init(struct drm_device *dev)
 	for (i = 0; i < VIA_MAX_CRTC; i++) {
 		ret = via_crtc_init(dev_priv, i);
 		if (ret) {
-			goto exit;
+			drm_err(dev, "Failed to initialize CRTC %u!\n", i + 1);
+			goto error_crtc_init;
 		}
 	}
 
@@ -1285,6 +1286,9 @@ int via_modeset_init(struct drm_device *dev)
 	drm_mode_config_reset(dev);
 
 	drm_kms_helper_poll_init(dev);
+	goto exit;
+error_crtc_init:
+	via_i2c_exit();
 exit:
 	return ret;
 }
commit 939181bbc84c18f3f578954aedd8f36ee34ccef2
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Sep 29 14:54:24 2023 -0700

    drm/via: Convert to use drmm_mode_config_init()
    
    drm_mode_config_init() is deprecated, so switch to the newer version.
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index e0f589e848d2..9a3340b42f7c 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1226,8 +1226,6 @@ int via_modeset_init(struct drm_device *dev)
 	dev_priv->number_fp = 0;
 	dev_priv->number_dvi = 0;
 
-	drm_mode_config_init(dev);
-
 	dev->mode_config.min_width = 0;
 	dev->mode_config.min_height = 0;
 	dev->mode_config.max_width = 2044;
@@ -1240,6 +1238,13 @@ int via_modeset_init(struct drm_device *dev)
 	dev->mode_config.cursor_width =
 	dev->mode_config.cursor_height = VIA_CURSOR_SIZE;
 
+	ret = drmm_mode_config_init(dev);
+	if (ret) {
+		drm_err(dev, "Failed to initialize mode setting "
+				"configuration!\n");
+		goto exit;
+	}
+
 	via_i2c_reg_init(dev_priv);
 	ret = via_i2c_init(dev);
 	if (ret) {
@@ -1290,8 +1295,6 @@ void via_modeset_fini(struct drm_device *dev)
 
 	drm_helper_force_disable_all(dev);
 
-	drm_mode_config_cleanup(dev);
-
 	via_i2c_exit();
 }
 
commit 788fcec277a9146daa8dc2c56511eb4eab61ce2e
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Sep 29 14:54:22 2023 -0700

    drm/via: Delete via_mode_config_init()
    
    Merge the code into via_modeset_init().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index c84d99b834c6..e0f589e848d2 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1215,9 +1215,16 @@ static const struct drm_mode_config_funcs via_drm_mode_config_funcs = {
 	.atomic_commit		= drm_atomic_helper_commit,
 };
 
-static void via_mode_config_init(struct drm_device *dev)
+int via_modeset_init(struct drm_device *dev)
 {
-	drm_dbg_driver(dev, "Entered %s.\n", __func__);
+	struct pci_dev *pdev = to_pci_dev(dev->dev);
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+	uint32_t i;
+	int ret = 0;
+
+	/* Initialize the number of display connectors. */
+	dev_priv->number_fp = 0;
+	dev_priv->number_dvi = 0;
 
 	drm_mode_config_init(dev);
 
@@ -1233,22 +1240,6 @@ static void via_mode_config_init(struct drm_device *dev)
 	dev->mode_config.cursor_width =
 	dev->mode_config.cursor_height = VIA_CURSOR_SIZE;
 
-	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
-}
-
-int via_modeset_init(struct drm_device *dev)
-{
-	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-	uint32_t i;
-	int ret = 0;
-
-	via_mode_config_init(dev);
-
-	/* Initialize the number of display connectors. */
-	dev_priv->number_fp = 0;
-	dev_priv->number_dvi = 0;
-
 	via_i2c_reg_init(dev_priv);
 	ret = via_i2c_init(dev);
 	if (ret) {
commit 57df999e2b39e893a3a24cd61938ae9b1d6a573d
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Sep 29 14:54:21 2023 -0700

    drm/via: Improve the error handling of via_mm_init()
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_object.c b/drivers/gpu/drm/via/via_object.c
index 319ff13c305c..34d959e6c0b3 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -303,9 +303,12 @@ int via_mm_init(struct drm_device *dev)
 				dev_priv->vram_size >> PAGE_SHIFT);
 	if (ret) {
 		drm_err(dev, "Failed initializing TTM VRAM memory manager.\n");
-		goto exit;
+		goto error_ttm_range_man;
 	}
 
+	goto exit;
+error_ttm_range_man:
+	ttm_device_fini(&dev_priv->bdev);
 exit:
 	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
commit 79100104efc804481a30face931f751c13988a15
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Fri Sep 29 14:54:19 2023 -0700

    drm/via: Improve the error handling of via_device_init()
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 092add07569d..c84d99b834c6 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1187,10 +1187,13 @@ static int via_device_init(struct drm_device *dev)
 	ret = via_mmio_init(dev);
 	if (ret) {
 		drm_err(dev, "Failed to initialize MMIO.\n");
-		goto exit;
+		goto error_mmio_init;
 	}
 
 	via_graphics_unlock(dev);
+	goto exit;
+error_mmio_init:
+	via_vram_fini(dev);
 exit:
 	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
commit 5106142cebfc1b219b7e1bee2de79168237d4716
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Sep 27 17:29:27 2023 -0700

    drm/via: Return -ENODEV if a host bridge is not found
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index ce36f6e85624..092add07569d 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -808,14 +808,14 @@ static int via_vram_init(struct drm_device *dev)
 
 	bus = pci_find_bus(0, 0);
 	if (!bus) {
-		ret = -EINVAL;
+		ret = -ENODEV;
 		drm_err(dev, "PCI bus not found!\n");
 		goto exit;
 	}
 
 	hb_fn0 = pci_get_slot(bus, PCI_DEVFN(0, 0));
 	if (!hb_fn0) {
-		ret = -EINVAL;
+		ret = -ENODEV;
 		drm_err(dev, "Host Bridge Function 0 not found!\n");
 		goto exit;
 	}
@@ -824,7 +824,7 @@ static int via_vram_init(struct drm_device *dev)
 		(pdev->device != PCI_DEVICE_ID_VIA_KM400_GFX)) {
 		hb_fn3 = pci_get_slot(bus, PCI_DEVFN(0, 3));
 		if (!hb_fn3) {
-			ret = -EINVAL;
+			ret = -ENODEV;
 			drm_err(dev, "Host Bridge Function 3 not found!\n");
 			goto error_hb_fn0;
 		}
@@ -947,6 +947,7 @@ static int via_vram_init(struct drm_device *dev)
 		break;
 
 	default:
+		ret = -ENODEV;
 		drm_err(dev, "Unknown Host Bidge device: 0x%04x\n",
 				hb_fn0->device);
 		goto error_hb_fn3;
commit c9dca1182711b36714edbe5bbad1f146f77c8741
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Sep 27 17:25:00 2023 -0700

    drm/via: Merge via_vram_init() and via_vram_detect()
    
    No longer need via_vram_detect(), so it will be deleted.
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index c21182dd7833..ce36f6e85624 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -739,7 +739,61 @@ static int vx900_mem_type(struct drm_device *dev,
 	return ret;
 }
 
-int via_vram_detect(struct drm_device *dev)
+static void via_quirks_init(struct drm_device *dev)
+{
+	struct pci_dev *pdev = to_pci_dev(dev->dev);
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
+
+	/*
+	 * Checking for VIA Technologies NanoBook reference design.
+	 * Examples include Everex CloudBook and Sylvania g netbook.
+	 * It is also called FIC CE260 or CE261 by its ODM (Original
+	 * Design Manufacturer) name.
+	 * This device has its strapping resistors set to a wrong
+	 * setting to handle DVI. As a result, the code needs to know
+	 * this in order to support DVI properly.
+	 */
+	if ((pdev->device == PCI_DEVICE_ID_VIA_UNICHROME_PRO_II) &&
+		(pdev->subsystem_vendor == 0x1509) &&
+		(pdev->subsystem_device == 0x2d30)) {
+		dev_priv->is_via_nanobook = true;
+	} else {
+		dev_priv->is_via_nanobook = false;
+	}
+
+	/*
+	 * Check for Quanta IL1 netbook. This is necessary
+	 * due to its flat panel connected to DVP1 (Digital
+	 * Video Port 1) rather than its LVDS channel.
+	 */
+	if ((pdev->device == PCI_DEVICE_ID_VIA_CHROME9_HC3) &&
+		(pdev->subsystem_vendor == 0x152d) &&
+		(pdev->subsystem_device == 0x0771)) {
+		dev_priv->is_quanta_il1 = true;
+	} else {
+		dev_priv->is_quanta_il1 = false;
+	}
+
+	/*
+	 * Samsung NC20 netbook has its FP connected to LVDS2
+	 * rather than the more logical LVDS1, hence, a special
+	 * flag register is needed for properly controlling its
+	 * FP.
+	 */
+	if ((pdev->device == PCI_DEVICE_ID_VIA_CHROME9_HC3) &&
+		(pdev->subsystem_vendor == 0x144d) &&
+		(pdev->subsystem_device == 0xc04e)) {
+		dev_priv->is_samsung_nc20 = true;
+	} else {
+		dev_priv->is_samsung_nc20 = false;
+	}
+
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
+}
+
+static int via_vram_init(struct drm_device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct pci_bus *bus;
@@ -958,6 +1012,11 @@ int via_vram_detect(struct drm_device *dev)
 	}
 
 	drm_dbg_driver(dev, "Found %s video RAM.\n", name);
+
+	/* Add an MTRR for the video RAM. */
+	dev_priv->vram_mtrr = arch_phys_wc_add(dev_priv->vram_start,
+						dev_priv->vram_size);
+	goto exit;
 error_hb_fn3:
 	if (hb_fn3)
 		pci_dev_put(hb_fn3);
@@ -969,75 +1028,6 @@ exit:
 	return ret;
 }
 
-static void via_quirks_init(struct drm_device *dev)
-{
-	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-
-	drm_dbg_driver(dev, "Entered %s.\n", __func__);
-
-	/*
-	 * Checking for VIA Technologies NanoBook reference design.
-	 * Examples include Everex CloudBook and Sylvania g netbook.
-	 * It is also called FIC CE260 or CE261 by its ODM (Original
-	 * Design Manufacturer) name.
-	 * This device has its strapping resistors set to a wrong
-	 * setting to handle DVI. As a result, the code needs to know
-	 * this in order to support DVI properly.
-	 */
-	if ((pdev->device == PCI_DEVICE_ID_VIA_UNICHROME_PRO_II) &&
-		(pdev->subsystem_vendor == 0x1509) &&
-		(pdev->subsystem_device == 0x2d30)) {
-		dev_priv->is_via_nanobook = true;
-	} else {
-		dev_priv->is_via_nanobook = false;
-	}
-
-	/*
-	 * Check for Quanta IL1 netbook. This is necessary
-	 * due to its flat panel connected to DVP1 (Digital
-	 * Video Port 1) rather than its LVDS channel.
-	 */
-	if ((pdev->device == PCI_DEVICE_ID_VIA_CHROME9_HC3) &&
-		(pdev->subsystem_vendor == 0x152d) &&
-		(pdev->subsystem_device == 0x0771)) {
-		dev_priv->is_quanta_il1 = true;
-	} else {
-		dev_priv->is_quanta_il1 = false;
-	}
-
-	/*
-	 * Samsung NC20 netbook has its FP connected to LVDS2
-	 * rather than the more logical LVDS1, hence, a special
-	 * flag register is needed for properly controlling its
-	 * FP.
-	 */
-	if ((pdev->device == PCI_DEVICE_ID_VIA_CHROME9_HC3) &&
-		(pdev->subsystem_vendor == 0x144d) &&
-		(pdev->subsystem_device == 0xc04e)) {
-		dev_priv->is_samsung_nc20 = true;
-	} else {
-		dev_priv->is_samsung_nc20 = false;
-	}
-
-	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
-}
-
-static int via_vram_init(struct drm_device *dev)
-{
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-	int ret = 0;
-
-	drm_dbg_driver(dev, "Entered %s.\n", __func__);
-
-	/* Add an MTRR for the video RAM. */
-	dev_priv->vram_mtrr = arch_phys_wc_add(dev_priv->vram_start,
-						dev_priv->vram_size);
-
-	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
-	return ret;
-}
-
 static void via_vram_fini(struct drm_device *dev)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -1184,12 +1174,6 @@ static int via_device_init(struct drm_device *dev)
 
 	via_quirks_init(dev);
 
-	ret = via_vram_detect(dev);
-	if (ret) {
-		drm_err(dev, "Failed to detect video RAM.\n");
-		goto exit;
-	}
-
 	/*
 	 * Map VRAM.
 	 */
commit 840f357e193da7a0d10329ef98339aa2ca7a7086
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Sep 27 15:59:42 2023 -0700

    drm/via: Refactor via_vram_detect()
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 4469dd7a30c2..c21182dd7833 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -742,10 +742,10 @@ static int vx900_mem_type(struct drm_device *dev,
 int via_vram_detect(struct drm_device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct pci_dev *bridge = NULL;
-	struct pci_dev *fn3 = NULL;
-	char *name = "unknown";
 	struct pci_bus *bus;
+	struct pci_dev *hb_fn0 = NULL;
+	struct pci_dev *hb_fn3 = NULL;
+	char *name = "unknown";
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 size;
 	int ret = 0;
@@ -753,25 +753,27 @@ int via_vram_detect(struct drm_device *dev)
 	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	bus = pci_find_bus(0, 0);
-	if (bus == NULL) {
+	if (!bus) {
 		ret = -EINVAL;
-		goto out_err;
+		drm_err(dev, "PCI bus not found!\n");
+		goto exit;
 	}
 
-	bridge = pci_get_slot(bus, PCI_DEVFN(0, 0));
-	fn3 = pci_get_slot(bus, PCI_DEVFN(0, 3));
-
-	if (!bridge) {
+	hb_fn0 = pci_get_slot(bus, PCI_DEVFN(0, 0));
+	if (!hb_fn0) {
 		ret = -EINVAL;
-		drm_err(dev, "No host bridge found...\n");
-		goto out_err;
+		drm_err(dev, "Host Bridge Function 0 not found!\n");
+		goto exit;
 	}
 
-	if (!fn3 && pdev->device != PCI_DEVICE_ID_VIA_CLE266_GFX
-		&& pdev->device != PCI_DEVICE_ID_VIA_KM400_GFX) {
-		ret = -EINVAL;
-		drm_err(dev, "No function 3 on host bridge...\n");
-		goto out_err;
+	if ((pdev->device != PCI_DEVICE_ID_VIA_CLE266_GFX) ||
+		(pdev->device != PCI_DEVICE_ID_VIA_KM400_GFX)) {
+		hb_fn3 = pci_get_slot(bus, PCI_DEVFN(0, 3));
+		if (!hb_fn3) {
+			ret = -EINVAL;
+			drm_err(dev, "Host Bridge Function 3 not found!\n");
+			goto error_hb_fn0;
+		}
 	}
 
 	if (pdev->device == PCI_DEVICE_ID_VIA_CHROME9_HD) {
@@ -780,37 +782,37 @@ int via_vram_detect(struct drm_device *dev)
 		dev_priv->vram_start = pci_resource_start(pdev, 0);
 	}
 
-	switch (bridge->device) {
+	switch (hb_fn0->device) {
 
 	/* CLE266 */
 	case PCI_DEVICE_ID_VIA_862X_0:
-		ret = cle266_mem_type(dev, bridge);
+		ret = cle266_mem_type(dev, hb_fn0);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn0;
 
-		ret = pci_read_config_byte(bridge, 0xE1, &size);
+		ret = pci_read_config_byte(hb_fn0, 0xE1, &size);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn0;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
 		break;
 
 	/* KM400 / KN400 / KM400A / KN400A */
 	case PCI_DEVICE_ID_VIA_8378_0:
-		ret = km400_mem_type(dev, bridge);
+		ret = km400_mem_type(dev, hb_fn0);
 
-		ret = pci_read_config_byte(bridge, 0xE1, &size);
+		ret = pci_read_config_byte(hb_fn0, 0xE1, &size);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn0;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
 		break;
 
 	/* P4M800 */
 	case PCI_DEVICE_ID_VIA_3296_0:
-		ret = p4m800_mem_type(dev, bus, fn3);
+		ret = p4m800_mem_type(dev, bus, hb_fn3);
 
-		ret = pci_read_config_byte(fn3, 0xA1, &size);
+		ret = pci_read_config_byte(hb_fn3, 0xA1, &size);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
 		break;
 
@@ -818,46 +820,46 @@ int via_vram_detect(struct drm_device *dev)
 	case PCI_DEVICE_ID_VIA_8380_0:
 	/* K8M890 */
 	case PCI_DEVICE_ID_VIA_VT3336:
-		ret = pci_read_config_byte(fn3, 0xA1, &size);
+		ret = pci_read_config_byte(hb_fn3, 0xA1, &size);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
 
-		if (bridge->device == PCI_DEVICE_ID_VIA_VT3336)
+		if (hb_fn0->device == PCI_DEVICE_ID_VIA_VT3336)
 			dev_priv->vram_size <<= 2;
 
 		ret = km8xx_mem_type(dev);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		break;
 
 	/* CN400 / PM800 / PM880 */
 	case PCI_DEVICE_ID_VIA_PX8X0_0:
-		ret = pci_read_config_byte(fn3, 0xA1, &size);
+		ret = pci_read_config_byte(hb_fn3, 0xA1, &size);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
 
-		ret = cn400_mem_type(dev, bus, fn3);
+		ret = cn400_mem_type(dev, bus, hb_fn3);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		break;
 
 	/* P4M800CE / P4M800 Pro / VN800 / CN700 */
 	case PCI_DEVICE_ID_VIA_P4M800CE:
 	/* P4M900 / VN896 / CN896 */
 	case PCI_DEVICE_ID_VIA_VT3364:
-		ret = pci_read_config_byte(fn3, 0xA1, &size);
+		ret = pci_read_config_byte(hb_fn3, 0xA1, &size);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
 
-		if (bridge->device != PCI_DEVICE_ID_VIA_P4M800CE)
+		if (hb_fn0->device != PCI_DEVICE_ID_VIA_P4M800CE)
 			dev_priv->vram_size <<= 2;
 
-		ret = cn700_mem_type(dev, fn3);
+		ret = cn700_mem_type(dev, hb_fn3);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		break;
 
 	/* CX700 / VX700 */
@@ -868,32 +870,32 @@ int via_vram_detect(struct drm_device *dev)
 	case PCI_DEVICE_ID_VIA_VX800_HB:
 	/* VX855 / VX875 */
 	case PCI_DEVICE_ID_VIA_VX855_HB:
-		ret = pci_read_config_byte(fn3, 0xA1, &size);
+		ret = pci_read_config_byte(hb_fn3, 0xA1, &size);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 22;
 
-		ret = cx700_mem_type(dev, fn3);
+		ret = cx700_mem_type(dev, hb_fn3);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		break;
 
 	/* VX900 */
 	case PCI_DEVICE_ID_VIA_VX900_HB:
-		ret = pci_read_config_byte(fn3, 0xA1, &size);
+		ret = pci_read_config_byte(hb_fn3, 0xA1, &size);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 22;
 
-		ret = vx900_mem_type(dev, fn3);
+		ret = vx900_mem_type(dev, hb_fn3);
 		if (ret)
-			goto out_err;
+			goto error_hb_fn3;
 		break;
 
 	default:
-		drm_err(dev, "Unknown north bridge device: 0x%04x\n",
-				bridge->device);
-		goto out_err;
+		drm_err(dev, "Unknown Host Bidge device: 0x%04x\n",
+				hb_fn0->device);
+		goto error_hb_fn3;
 	}
 
 	switch (dev_priv->vram_type) {
@@ -956,12 +958,13 @@ int via_vram_detect(struct drm_device *dev)
 	}
 
 	drm_dbg_driver(dev, "Found %s video RAM.\n", name);
-out_err:
-	if (bridge)
-		pci_dev_put(bridge);
-	if (fn3)
-		pci_dev_put(fn3);
-
+error_hb_fn3:
+	if (hb_fn3)
+		pci_dev_put(hb_fn3);
+error_hb_fn0:
+	if (hb_fn0)
+		pci_dev_put(hb_fn0);
+exit:
 	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
commit 75d47d420f42621c79bc2310b0f48df70734f184
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Sep 27 15:59:40 2023 -0700

    drm/via: Convert drm_dbg_kms() to drm_dbg_driver() for non-KMS functions
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 0a97949d6d37..932afe95ce6d 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -61,27 +61,27 @@ static int via_driver_open(struct drm_device *dev,
 {
 	int ret = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 static void via_driver_postclose(struct drm_device *dev,
 					struct drm_file *file_priv)
 {
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_driver_lastclose(struct drm_device *dev)
 {
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	drm_fb_helper_lastclose(dev);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static int via_driver_dumb_create(struct drm_file *file_priv,
@@ -95,7 +95,7 @@ static int via_driver_dumb_create(struct drm_file *file_priv,
 	uint64_t size;
 	int ret;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	/*
 	 * Calculate the parameters for the dumb buffer.
@@ -122,7 +122,7 @@ static int via_driver_dumb_create(struct drm_file *file_priv,
 	args->pitch = pitch;
 	args->size = size;
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -136,7 +136,7 @@ static int via_driver_dumb_map_offset(struct drm_file *file_priv,
 	struct via_bo *bo;
 	int ret = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	gem = drm_gem_object_lookup(file_priv, handle);
 	if (!gem) {
@@ -150,7 +150,7 @@ static int via_driver_dumb_map_offset(struct drm_file *file_priv,
 
 	drm_gem_object_put(gem);
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index d3bb9b94d096..4469dd7a30c2 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -750,7 +750,7 @@ int via_vram_detect(struct drm_device *dev)
 	u8 size;
 	int ret = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	bus = pci_find_bus(0, 0);
 	if (bus == NULL) {
@@ -962,7 +962,7 @@ out_err:
 	if (fn3)
 		pci_dev_put(fn3);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -971,7 +971,7 @@ static void via_quirks_init(struct drm_device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	/*
 	 * Checking for VIA Technologies NanoBook reference design.
@@ -1017,7 +1017,7 @@ static void via_quirks_init(struct drm_device *dev)
 		dev_priv->is_samsung_nc20 = false;
 	}
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static int via_vram_init(struct drm_device *dev)
@@ -1025,13 +1025,13 @@ static int via_vram_init(struct drm_device *dev)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	int ret = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	/* Add an MTRR for the video RAM. */
 	dev_priv->vram_mtrr = arch_phys_wc_add(dev_priv->vram_start,
 						dev_priv->vram_size);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -1039,7 +1039,7 @@ static void via_vram_fini(struct drm_device *dev)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	if (dev_priv->vram_mtrr) {
 		arch_phys_wc_del(dev_priv->vram_mtrr);
@@ -1048,7 +1048,7 @@ static void via_vram_fini(struct drm_device *dev)
 		dev_priv->vram_mtrr = 0;
 	}
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static int via_mmio_init(struct drm_device *dev)
@@ -1057,7 +1057,7 @@ static int via_mmio_init(struct drm_device *dev)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	int ret = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	/*
 	 * PCI BAR1 is the MMIO memory window for all
@@ -1075,7 +1075,7 @@ static int via_mmio_init(struct drm_device *dev)
 	}
 
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -1083,14 +1083,14 @@ static void via_mmio_fini(struct drm_device *dev)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	if (dev_priv->mmio) {
 		iounmap(dev_priv->mmio);
 		dev_priv->mmio = NULL;
 	}
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_graphics_unlock(struct drm_device *dev)
@@ -1098,7 +1098,7 @@ static void via_graphics_unlock(struct drm_device *dev)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	uint8_t temp;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	/*
 	 * Enable VGA subsystem.
@@ -1119,7 +1119,7 @@ static void via_graphics_unlock(struct drm_device *dev)
 	 */
 	svga_wseq_mask(VGABASE, 0x1a, BIT(3), BIT(3));
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_chip_revision_info(struct drm_device *dev)
@@ -1128,7 +1128,7 @@ static void via_chip_revision_info(struct drm_device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	u8 tmp;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	switch (pdev->device) {
 	/* CLE266 Chipset */
@@ -1170,14 +1170,14 @@ static void via_chip_revision_info(struct drm_device *dev)
 		break;
 	}
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static int via_device_init(struct drm_device *dev)
 {
 	int ret;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	via_quirks_init(dev);
 
@@ -1204,18 +1204,18 @@ static int via_device_init(struct drm_device *dev)
 
 	via_graphics_unlock(dev);
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 static void via_device_fini(struct drm_device *dev)
 {
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	via_mmio_fini(dev);
 	via_vram_fini(dev);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static const struct drm_mode_config_funcs via_drm_mode_config_funcs = {
@@ -1226,7 +1226,7 @@ static const struct drm_mode_config_funcs via_drm_mode_config_funcs = {
 
 static void via_mode_config_init(struct drm_device *dev)
 {
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	drm_mode_config_init(dev);
 
@@ -1242,7 +1242,7 @@ static void via_mode_config_init(struct drm_device *dev)
 	dev->mode_config.cursor_width =
 	dev->mode_config.cursor_height = VIA_CURSOR_SIZE;
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 int via_modeset_init(struct drm_device *dev)
@@ -1317,7 +1317,7 @@ int via_drm_init(struct drm_device *dev)
 {
 	int ret = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	ret = via_device_init(dev);
 	if (ret) {
@@ -1345,17 +1345,17 @@ error_modeset:
 	via_mm_fini(dev);
 	via_device_fini(dev);
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 void via_drm_fini(struct drm_device *dev)
 {
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	via_modeset_fini(dev);
 	via_mm_fini(dev);
 	via_device_fini(dev);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
diff --git a/drivers/gpu/drm/via/via_ioctl.c b/drivers/gpu/drm/via/via_ioctl.c
index b5e4934162e4..8f8ce7137061 100644
--- a/drivers/gpu/drm/via/via_ioctl.c
+++ b/drivers/gpu/drm/via/via_ioctl.c
@@ -43,7 +43,7 @@ int via_gem_alloc_ioctl(struct drm_device *dev, void *data,
 	uint32_t handle;
 	int ret;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	ret = via_bo_create(dev, &dev_priv->bdev, args->size,
 				ttm_bo_type_device, args->domain, false, &bo);
@@ -65,7 +65,7 @@ int via_gem_alloc_ioctl(struct drm_device *dev, void *data,
 	args->handle	= handle;
 	args->offset	= ttm_bo->resource->start << PAGE_SHIFT;
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -77,7 +77,7 @@ int via_gem_mmap_ioctl(struct drm_device *dev, void *data,
 	struct ttm_buffer_object *ttm_bo;
 	int ret = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	gem = drm_gem_object_lookup(file_priv, args->handle);
 	if (!gem) {
@@ -89,6 +89,6 @@ int via_gem_mmap_ioctl(struct drm_device *dev, void *data,
 
 	args->offset = drm_vma_node_offset_addr(&ttm_bo->base.vma_node);
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
diff --git a/drivers/gpu/drm/via/via_object.c b/drivers/gpu/drm/via/via_object.c
index a967fad770e1..319ff13c305c 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -47,11 +47,11 @@ static void via_gem_free(struct drm_gem_object *obj)
 				struct ttm_buffer_object, base);
 	struct drm_device *dev = ttm_bo->base.dev;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	ttm_bo_put(ttm_bo);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static const struct vm_operations_struct via_ttm_bo_vm_ops = {
@@ -76,7 +76,7 @@ void via_ttm_domain_to_placement(struct via_bo *bo,
 	struct drm_device *dev = ttm_bo->base.dev;
 	unsigned i = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	bo->placement.placement = bo->placements;
 	bo->placement.busy_placement = bo->placements;
@@ -108,7 +108,7 @@ void via_ttm_domain_to_placement(struct via_bo *bo,
 	bo->placement.num_placement = i;
 	bo->placement.num_busy_placement = i;
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 void via_ttm_bo_destroy(struct ttm_buffer_object *tbo)
@@ -116,14 +116,14 @@ void via_ttm_bo_destroy(struct ttm_buffer_object *tbo)
 	struct via_bo *bo;
 	struct drm_device *dev = tbo->base.dev;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	bo = to_ttm_bo(tbo);
 
 	drm_gem_object_release(&tbo->base);
 	kfree(bo);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 int via_bo_pin(struct via_bo *bo, uint32_t ttm_domain)
@@ -133,7 +133,7 @@ int via_bo_pin(struct via_bo *bo, uint32_t ttm_domain)
 	struct ttm_operation_ctx ctx = {false, false};
 	int ret = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	if (ttm_bo->pin_count) {
 		goto pin;
@@ -149,7 +149,7 @@ pin:
 	ttm_bo_pin(ttm_bo);
 exit:
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -158,11 +158,11 @@ void via_bo_unpin(struct via_bo *bo)
 	struct ttm_buffer_object *ttm_bo = &bo->ttm_bo;
 	struct drm_device *dev = ttm_bo->base.dev;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	ttm_bo_unpin(ttm_bo);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 int via_bo_create(struct drm_device *dev,
@@ -178,7 +178,7 @@ int via_bo_create(struct drm_device *dev,
 	struct via_bo *bo;
 	int ret;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	bo = kzalloc(sizeof(*bo), GFP_KERNEL);
 	if (!bo) {
@@ -241,7 +241,7 @@ int via_bo_create(struct drm_device *dev,
 error:
 	kfree(bo);
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -251,7 +251,7 @@ void via_bo_destroy(struct via_bo *bo, bool kmap)
 	struct drm_device *dev = ttm_bo->base.dev;
 	int ret;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	if (kmap) {
 		ttm_bo_kunmap(&bo->kmap);
@@ -270,7 +270,7 @@ void via_bo_destroy(struct via_bo *bo, bool kmap)
 
 	ttm_bo_put(ttm_bo);
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 int via_mm_init(struct drm_device *dev)
@@ -278,7 +278,7 @@ int via_mm_init(struct drm_device *dev)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	int ret;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	/*
 	 * Initialize bdev ttm_bo_device struct.
@@ -307,7 +307,7 @@ int via_mm_init(struct drm_device *dev)
 	}
 
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -315,11 +315,11 @@ void via_mm_fini(struct drm_device *dev)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	ttm_range_man_fini(&dev_priv->bdev, TTM_PL_VRAM);
 
 	ttm_device_fini(&dev_priv->bdev);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
diff --git a/drivers/gpu/drm/via/via_pm.c b/drivers/gpu/drm/via/via_pm.c
index 12991312a883..f5efa9e89abc 100644
--- a/drivers/gpu/drm/via/via_pm.c
+++ b/drivers/gpu/drm/via/via_pm.c
@@ -40,7 +40,7 @@ int via_dev_pm_ops_suspend(struct device *dev)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(drm_dev);
 	int ret = 0;
 
-	drm_dbg_kms(drm_dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(drm_dev, "Entered %s.\n", __func__);
 
 	console_lock();
 
@@ -91,7 +91,7 @@ int via_dev_pm_ops_suspend(struct device *dev)
 	pci_save_state(pdev);
 	pci_disable_device(pdev);
 exit:
-	drm_dbg_kms(drm_dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(drm_dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -104,7 +104,7 @@ int via_dev_pm_ops_resume(struct device *dev)
 	u8 val;
 	int ret = 0;
 
-	drm_dbg_kms(drm_dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(drm_dev, "Entered %s.\n", __func__);
 
 	if (pci_enable_device(pdev)) {
 		drm_err(drm_dev, "Failed to initialize a PCI "
@@ -184,6 +184,6 @@ int via_dev_pm_ops_resume(struct device *dev)
 	}
 
 exit:
-	drm_dbg_kms(drm_dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(drm_dev, "Exiting %s.\n", __func__);
 	return ret;
 }
diff --git a/drivers/gpu/drm/via/via_ttm.c b/drivers/gpu/drm/via/via_ttm.c
index d62831e76819..68f44446011f 100644
--- a/drivers/gpu/drm/via/via_ttm.c
+++ b/drivers/gpu/drm/via/via_ttm.c
@@ -44,9 +44,9 @@ static void via_bo_move_notify(struct ttm_buffer_object *bo, bool evict,
 {
 	struct drm_device *dev = bo->base.dev;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return;
 }
 
@@ -83,7 +83,7 @@ static void via_bo_evict_flags(struct ttm_buffer_object *bo,
 	struct drm_device *dev = bo->base.dev;
 	struct via_bo *driver_bo = to_ttm_bo(bo);
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	if (bo->destroy == &via_ttm_bo_destroy) {
 		goto exit;
@@ -100,7 +100,7 @@ static void via_bo_evict_flags(struct ttm_buffer_object *bo,
 
 	*placement = driver_bo->placement;
 exit:
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 }
 
 static int via_bo_move(struct ttm_buffer_object *bo, bool evict,
@@ -136,11 +136,11 @@ static void via_bo_delete_mem_notify(struct ttm_buffer_object *bo)
 {
 	struct drm_device *dev = bo->base.dev;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	via_bo_move_notify(bo, false, NULL);
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return;
 }
 
@@ -152,7 +152,7 @@ static int via_bo_io_mem_reserve(struct ttm_device *bdev,
 	struct drm_device *dev = &dev_priv->dev;
 	int ret = 0;
 
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+	drm_dbg_driver(dev, "Entered %s.\n", __func__);
 
 	switch (mem->mem_type) {
 	case TTM_PL_SYSTEM:
@@ -167,7 +167,7 @@ static int via_bo_io_mem_reserve(struct ttm_device *bdev,
 		break;
 	}
 
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
+	drm_dbg_driver(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 


More information about the openchrome-devel mailing list