[openchrome-devel] drm-openchrome: Branch 'drm-next-6.5' - 48 commits - drivers/gpu/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Mon May 22 17:42:02 UTC 2023


 drivers/gpu/drm/via/Makefile      |    1 
 drivers/gpu/drm/via/via_crtc.c    |   79 ++++++------
 drivers/gpu/drm/via/via_crtc_hw.h |  188 ------------------------------
 drivers/gpu/drm/via/via_cursor.c  |    3 
 drivers/gpu/drm/via/via_dac.c     |  111 ++++++------------
 drivers/gpu/drm/via/via_drv.c     |   37 ++----
 drivers/gpu/drm/via/via_drv.h     |   46 +++----
 drivers/gpu/drm/via/via_encoder.c |  197 --------------------------------
 drivers/gpu/drm/via/via_hdmi.c    |    4 
 drivers/gpu/drm/via/via_i2c.c     |    2 
 drivers/gpu/drm/via/via_init.c    |  200 +++++++++++++++-----------------
 drivers/gpu/drm/via/via_ioctl.c   |    8 -
 drivers/gpu/drm/via/via_lvds.c    |  212 ++++++++++++++++++----------------
 drivers/gpu/drm/via/via_object.c  |   80 ++++++-------
 drivers/gpu/drm/via/via_pm.c      |   14 +-
 drivers/gpu/drm/via/via_sii164.c  |  156 +++++++++++++------------
 drivers/gpu/drm/via/via_tmds.c    |  167 ++++++++++++++-------------
 drivers/gpu/drm/via/via_ttm.c     |   22 ++-
 drivers/gpu/drm/via/via_tx.c      |  231 ++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/via/via_vt1632.c  |  156 +++++++++++++------------
 20 files changed, 876 insertions(+), 1038 deletions(-)

New commits:
commit f3533edf40405f8f622772480d47b3b76dde1282
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 10:38:10 2023 -0700

    drm/via: Version bumped to 3.6.8
    
    Discontinued the use of DRM_DEBUG_KMS(), DRM_ERROR(), and DRM_INFO().
    
    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 1c3b9f61f1bc..b650fb5986e1 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,7 +44,7 @@
 
 #define DRIVER_MAJOR		3
 #define DRIVER_MINOR		6
-#define DRIVER_PATCHLEVEL	7
+#define DRIVER_PATCHLEVEL	8
 #define DRIVER_NAME		"via"
 #define DRIVER_DESC		"OpenChrome DRM for VIA Technologies Chrome"
 #define DRIVER_DATE		"20230522"
commit 4210fda780c850345250440e6868b88fdb903d8d
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:50:24 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_tx.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_tx.c b/drivers/gpu/drm/via/via_tx.c
index 0df832ef9d12..0a41bf663aa2 100644
--- a/drivers/gpu/drm/via/via_tx.c
+++ b/drivers/gpu/drm/via/via_tx.c
@@ -33,7 +33,7 @@ void via_transmitter_io_pad_state(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_DIP0:
@@ -86,7 +86,7 @@ void via_transmitter_io_pad_state(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_output_enable(struct drm_device *dev,
@@ -94,7 +94,7 @@ void via_output_enable(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_DIP0:
@@ -107,7 +107,7 @@ void via_output_enable(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_clock_source(struct drm_device *dev,
@@ -115,7 +115,7 @@ void via_clock_source(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_DIP0:
@@ -128,7 +128,7 @@ void via_clock_source(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_transmitter_clock_drive_strength(struct drm_device *dev,
@@ -137,7 +137,7 @@ void via_transmitter_clock_drive_strength(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_DVP0:
@@ -152,7 +152,7 @@ void via_transmitter_clock_drive_strength(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_transmitter_data_drive_strength(struct drm_device *dev,
@@ -160,7 +160,7 @@ void via_transmitter_data_drive_strength(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_DVP0:
@@ -175,7 +175,7 @@ void via_transmitter_data_drive_strength(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_transmitter_display_source(struct drm_device *dev,
@@ -184,7 +184,7 @@ void via_transmitter_display_source(struct drm_device *dev,
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 display_source = index & 0x01;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_DIP0:
@@ -227,5 +227,5 @@ void via_transmitter_display_source(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit afba06ce2097379d30823166ffc87a74fa7f16bc
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:49:48 2023 -0700

    drm/via: Use drm_device for function argument inside via_tx.c
    
    Obtain a pointer to via_drm_priv via drm_device.
    
    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 4e603f34c8c3..1c3b9f61f1bc 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -324,17 +324,20 @@ void via_bo_destroy(struct via_bo *bo, bool kmap);
 int via_mm_init(struct drm_device *dev);
 void via_mm_fini(struct drm_device *dev);
 
-void via_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
-					uint32_t di_port, bool io_pad_on);
-void via_output_enable(struct via_drm_priv *dev_priv,
+void via_transmitter_io_pad_state(struct drm_device *dev,
+					uint32_t di_port,
+					bool io_pad_on);
+void via_output_enable(struct drm_device *dev,
 			uint32_t di_port, bool output_enable);
-void via_clock_source(struct via_drm_priv *dev_priv, uint32_t di_port,
-			bool clock_source);
-void via_transmitter_clock_drive_strength(struct via_drm_priv *dev_priv,
-					u32 di_port, u8 drive_strength);
-void via_transmitter_data_drive_strength(struct via_drm_priv *dev_priv,
-					u32 di_port, u8 drive_strength);
-void via_transmitter_display_source(struct via_drm_priv *dev_priv,
+void via_clock_source(struct drm_device *dev,
+			uint32_t di_port, bool clock_source);
+void via_transmitter_clock_drive_strength(struct drm_device *dev,
+						u32 di_port,
+						u8 drive_strength);
+void via_transmitter_data_drive_strength(struct drm_device *dev,
+						u32 di_port,
+						u8 drive_strength);
+void via_transmitter_display_source(struct drm_device *dev,
 					u32 di_port, int index);
 
 void via_encoder_destroy(struct drm_encoder *encoder);
diff --git a/drivers/gpu/drm/via/via_sii164.c b/drivers/gpu/drm/via/via_sii164.c
index 2ff0bbeff863..f55304347534 100644
--- a/drivers/gpu/drm/via/via_sii164.c
+++ b/drivers/gpu/drm/via/via_sii164.c
@@ -140,7 +140,6 @@ static void via_sii164_dpms(struct drm_encoder *encoder, int mode)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -164,13 +163,13 @@ static void via_sii164_dpms(struct drm_encoder *encoder, int mode)
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
 		via_sii164_power(dev, i2c_bus, true);
-		via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+		via_transmitter_io_pad_state(dev, enc->di_port, true);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
 		via_sii164_power(dev, i2c_bus, false);
-		via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+		via_transmitter_io_pad_state(dev, enc->di_port, false);
 		break;
 	default:
 		drm_err(dev, "Bad DPMS mode.");
@@ -204,7 +203,6 @@ static void via_sii164_mode_set(struct drm_encoder *encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -224,18 +222,18 @@ static void via_sii164_mode_set(struct drm_encoder *encoder,
 		goto exit;
 	}
 
-	via_transmitter_clock_drive_strength(dev_priv, enc->di_port, 0x03);
-	via_transmitter_data_drive_strength(dev_priv, enc->di_port, 0x03);
-	via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+	via_transmitter_clock_drive_strength(dev, enc->di_port, 0x03);
+	via_transmitter_data_drive_strength(dev, enc->di_port, 0x03);
+	via_transmitter_io_pad_state(dev, enc->di_port, true);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
-		via_clock_source(dev_priv, enc->di_port, true);
+		via_clock_source(dev, enc->di_port, true);
 	}
 
 	via_sii164_display_registers(dev, i2c_bus);
 	via_sii164_init_registers(dev, i2c_bus);
 	via_sii164_display_registers(dev, i2c_bus);
 
-	via_transmitter_display_source(dev_priv, enc->di_port, iga->index);
+	via_transmitter_display_source(dev, enc->di_port, iga->index);
 exit:
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
@@ -247,7 +245,6 @@ static void via_sii164_prepare(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -268,9 +265,9 @@ static void via_sii164_prepare(struct drm_encoder *encoder)
 	}
 
 	via_sii164_power(dev, i2c_bus, false);
-	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+	via_transmitter_io_pad_state(dev, enc->di_port, false);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
-		via_output_enable(dev_priv, enc->di_port, false);
+		via_output_enable(dev, enc->di_port, false);
 	}
 
 exit:
@@ -283,7 +280,6 @@ static void via_sii164_commit(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -304,9 +300,9 @@ static void via_sii164_commit(struct drm_encoder *encoder)
 	}
 
 	via_sii164_power(dev, i2c_bus, true);
-	via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+	via_transmitter_io_pad_state(dev, enc->di_port, true);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
-		via_output_enable(dev_priv, enc->di_port, true);
+		via_output_enable(dev, enc->di_port, true);
 	}
 
 exit:
@@ -318,7 +314,6 @@ static void via_sii164_disable(struct drm_encoder *encoder)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -339,7 +334,7 @@ static void via_sii164_disable(struct drm_encoder *encoder)
 	}
 
 	via_sii164_power(dev, i2c_bus, false);
-	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+	via_transmitter_io_pad_state(dev, enc->di_port, false);
 exit:
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
diff --git a/drivers/gpu/drm/via/via_tx.c b/drivers/gpu/drm/via/via_tx.c
index 60c3253239eb..0df832ef9d12 100644
--- a/drivers/gpu/drm/via/via_tx.c
+++ b/drivers/gpu/drm/via/via_tx.c
@@ -27,10 +27,12 @@
 #include "via_drv.h"
 
 
-void via_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
+void via_transmitter_io_pad_state(struct drm_device *dev,
 						uint32_t di_port,
 						bool io_pad_on)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch(di_port) {
@@ -87,9 +89,11 @@ void via_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-void via_output_enable(struct via_drm_priv *dev_priv, uint32_t di_port,
-			bool output_enable)
+void via_output_enable(struct drm_device *dev,
+			uint32_t di_port, bool output_enable)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch(di_port) {
@@ -106,9 +110,11 @@ void via_output_enable(struct via_drm_priv *dev_priv, uint32_t di_port,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-void via_clock_source(struct via_drm_priv *dev_priv, uint32_t di_port,
-			bool clock_source)
+void via_clock_source(struct drm_device *dev,
+			uint32_t di_port, bool clock_source)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch(di_port) {
@@ -125,10 +131,12 @@ void via_clock_source(struct via_drm_priv *dev_priv, uint32_t di_port,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-void via_transmitter_clock_drive_strength(
-					struct via_drm_priv *dev_priv,
-					u32 di_port, u8 drive_strength)
+void via_transmitter_clock_drive_strength(struct drm_device *dev,
+						u32 di_port,
+						u8 drive_strength)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch(di_port) {
@@ -147,10 +155,11 @@ void via_transmitter_clock_drive_strength(
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-void via_transmitter_data_drive_strength(
-					struct via_drm_priv *dev_priv,
+void via_transmitter_data_drive_strength(struct drm_device *dev,
 					u32 di_port, u8 drive_strength)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch(di_port) {
@@ -169,9 +178,10 @@ void via_transmitter_data_drive_strength(
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-void via_transmitter_display_source(struct via_drm_priv *dev_priv,
-						u32 di_port, int index)
+void via_transmitter_display_source(struct drm_device *dev,
+					u32 di_port, int index)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 display_source = index & 0x01;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/via/via_vt1632.c b/drivers/gpu/drm/via/via_vt1632.c
index 1e313506909f..99b6da9f4192 100644
--- a/drivers/gpu/drm/via/via_vt1632.c
+++ b/drivers/gpu/drm/via/via_vt1632.c
@@ -160,7 +160,6 @@ static void via_vt1632_dpms(struct drm_encoder *encoder, int mode)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -184,13 +183,13 @@ static void via_vt1632_dpms(struct drm_encoder *encoder, int mode)
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
 		via_vt1632_power(dev, i2c_bus, true);
-		via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+		via_transmitter_io_pad_state(dev, enc->di_port, true);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
 		via_vt1632_power(dev, i2c_bus, false);
-		via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+		via_transmitter_io_pad_state(dev, enc->di_port, false);
 		break;
 	default:
 		drm_err(dev, "Bad DPMS mode.");
@@ -224,7 +223,6 @@ static void via_vt1632_mode_set(struct drm_encoder *encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -244,18 +242,18 @@ static void via_vt1632_mode_set(struct drm_encoder *encoder,
 		goto exit;
 	}
 
-	via_transmitter_clock_drive_strength(dev_priv, enc->di_port, 0x03);
-	via_transmitter_data_drive_strength(dev_priv, enc->di_port, 0x03);
-	via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+	via_transmitter_clock_drive_strength(dev, enc->di_port, 0x03);
+	via_transmitter_data_drive_strength(dev, enc->di_port, 0x03);
+	via_transmitter_io_pad_state(dev, enc->di_port, true);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
-		via_clock_source(dev_priv, enc->di_port, true);
+		via_clock_source(dev, enc->di_port, true);
 	}
 
 	via_vt1632_display_registers(dev, i2c_bus);
 	via_vt1632_init_registers(dev, i2c_bus);
 	via_vt1632_display_registers(dev, i2c_bus);
 
-	via_transmitter_display_source(dev_priv, enc->di_port, iga->index);
+	via_transmitter_display_source(dev, enc->di_port, iga->index);
 exit:
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
@@ -267,7 +265,6 @@ static void via_vt1632_prepare(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -288,9 +285,9 @@ static void via_vt1632_prepare(struct drm_encoder *encoder)
 	}
 
 	via_vt1632_power(dev, i2c_bus, false);
-	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+	via_transmitter_io_pad_state(dev, enc->di_port, false);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
-		via_output_enable(dev_priv, enc->di_port, false);
+		via_output_enable(dev, enc->di_port, false);
 	}
 
 exit:
@@ -303,7 +300,6 @@ static void via_vt1632_commit(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -324,9 +320,9 @@ static void via_vt1632_commit(struct drm_encoder *encoder)
 	}
 
 	via_vt1632_power(dev, i2c_bus, true);
-	via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+	via_transmitter_io_pad_state(dev, enc->di_port, true);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
-		via_output_enable(dev_priv, enc->di_port, true);
+		via_output_enable(dev, enc->di_port, true);
 	}
 
 exit:
@@ -338,7 +334,6 @@ static void via_vt1632_disable(struct drm_encoder *encoder)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
@@ -359,7 +354,7 @@ static void via_vt1632_disable(struct drm_encoder *encoder)
 	}
 
 	via_vt1632_power(dev, i2c_bus, false);
-	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+	via_transmitter_io_pad_state(dev, enc->di_port, false);
 exit:
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit 7ec49dd4223bb365256eb376cfb4b6fc8564e2a9
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:43:58 2023 -0700

    drm/via: Convert to drm_err() for via_vt1632.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_vt1632.c b/drivers/gpu/drm/via/via_vt1632.c
index 582a14d66ccd..1e313506909f 100644
--- a/drivers/gpu/drm/via/via_vt1632.c
+++ b/drivers/gpu/drm/via/via_vt1632.c
@@ -193,7 +193,7 @@ static void via_vt1632_dpms(struct drm_encoder *encoder, int mode)
 		via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 		break;
 	default:
-		DRM_ERROR("Bad DPMS mode.");
+		drm_err(dev, "Bad DPMS mode.");
 		break;
 	}
 
@@ -573,7 +573,7 @@ void via_vt1632_init(struct drm_device *dev)
 
 	enc = kzalloc(sizeof(*enc) + sizeof(*con), GFP_KERNEL);
 	if (!enc) {
-		DRM_ERROR("Failed to allocate connector "
+		drm_err(dev, "Failed to allocate connector "
 				"and encoder.\n");
 		goto exit;
 	}
commit 965927b5d4c17cf7b14c820763a962e13ae1489a
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:43:56 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_vt1632.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_vt1632.c b/drivers/gpu/drm/via/via_vt1632.c
index 663fea639d57..582a14d66ccd 100644
--- a/drivers/gpu/drm/via/via_vt1632.c
+++ b/drivers/gpu/drm/via/via_vt1632.c
@@ -51,17 +51,17 @@ static void via_vt1632_power(struct drm_device *dev,
 	u8 buf;
 	u8 power_bit;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_i2c_readbytes(i2c_bus, 0x08, 0x08, &buf, 1);
 	power_bit = power_state ? VIA_VT1632_PDB : 0x00;
 	buf &= ~power_bit;
 	buf |= power_bit;
 	via_i2c_writebytes(i2c_bus, 0x08, 0x08, &buf, 1);
-	DRM_DEBUG_KMS("VT1632 (DVI) Power: %s\n",
+	drm_dbg_kms(dev, "VT1632 (DVI) Power: %s\n",
 			power_state ? "On" : "Off");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 
@@ -71,17 +71,17 @@ static bool via_vt1632_sense(struct drm_device *dev,
 	u8 buf;
 	bool rx_detected = false;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_i2c_readbytes(i2c_bus, 0x08, 0x09, &buf, 1);
 	if (buf & BIT(2)) {
 		rx_detected = true;
 	}
 
-	DRM_DEBUG_KMS("VT1632 (DVI) Connector Sense: %s\n",
+	drm_dbg_kms(dev, "VT1632 (DVI) Connector Sense: %s\n",
 			rx_detected ? "Connected" : "Not Connected");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return rx_detected;
 }
 
@@ -91,15 +91,15 @@ static void via_vt1632_display_registers(struct drm_device *dev,
 	uint8_t i;
 	u8 buf;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
-	DRM_DEBUG_KMS("VT1632(A) Registers:\n");
+	drm_dbg_kms(dev, "VT1632(A) Registers:\n");
 	for (i = 0; i < 0x10; i++) {
 		via_i2c_readbytes(i2c_bus, 0x08, i, &buf, 1);
-		DRM_DEBUG_KMS("0x%02x: 0x%02x\n", i, buf);
+		drm_dbg_kms(dev, "0x%02x: 0x%02x\n", i, buf);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_vt1632_init_registers(struct drm_device *dev,
@@ -107,7 +107,7 @@ static void via_vt1632_init_registers(struct drm_device *dev,
 {
 	u8 buf;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/*
 	 * For Wyse Cx0 thin client VX855 chipset DVP1 (Digital Video
@@ -147,7 +147,7 @@ static void via_vt1632_init_registers(struct drm_device *dev,
 	buf = 0x00;
 	via_i2c_writebytes(i2c_bus, 0x08, 0x0c, &buf, 1);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 
@@ -163,7 +163,7 @@ static void via_vt1632_dpms(struct drm_encoder *encoder, int mode)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -198,18 +198,20 @@ static void via_vt1632_dpms(struct drm_encoder *encoder, int mode)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static bool via_vt1632_mode_fixup(struct drm_encoder *encoder,
 				const struct drm_display_mode *mode,
 				struct drm_display_mode *adjusted_mode)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	struct drm_device *dev = encoder->dev;
+
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	drm_mode_set_crtcinfo(adjusted_mode, 0);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return true;
 }
 
@@ -225,7 +227,7 @@ static void via_vt1632_mode_set(struct drm_encoder *encoder,
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -256,7 +258,7 @@ static void via_vt1632_mode_set(struct drm_encoder *encoder,
 	via_transmitter_display_source(dev_priv, enc->di_port, iga->index);
 exit:
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_vt1632_prepare(struct drm_encoder *encoder)
@@ -268,7 +270,7 @@ static void via_vt1632_prepare(struct drm_encoder *encoder)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -292,7 +294,7 @@ static void via_vt1632_prepare(struct drm_encoder *encoder)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_vt1632_commit(struct drm_encoder *encoder)
@@ -304,7 +306,7 @@ static void via_vt1632_commit(struct drm_encoder *encoder)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -328,7 +330,7 @@ static void via_vt1632_commit(struct drm_encoder *encoder)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_vt1632_disable(struct drm_encoder *encoder)
@@ -339,7 +341,7 @@ static void via_vt1632_disable(struct drm_encoder *encoder)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -359,7 +361,7 @@ static void via_vt1632_disable(struct drm_encoder *encoder)
 	via_vt1632_power(dev, i2c_bus, false);
 	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 
@@ -384,7 +386,7 @@ static enum drm_connector_status via_vt1632_detect(
 	struct i2c_adapter *i2c_bus;
 	enum drm_connector_status ret = connector_status_disconnected;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -403,11 +405,11 @@ static enum drm_connector_status via_vt1632_detect(
 
 	if (via_vt1632_sense(dev, i2c_bus)) {
 		ret = connector_status_connected;
-		DRM_DEBUG_KMS("DVI detected.\n");
+		drm_dbg_kms(dev, "DVI detected.\n");
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -427,6 +429,7 @@ static const struct drm_connector_funcs via_vt1632_drm_connector_funcs = {
 int via_vt1632_mode_valid(struct drm_connector *connector,
 					struct drm_display_mode *mode)
 {
+	struct drm_device *dev = connector->dev;
 	struct via_connector *con = container_of(connector,
 					struct via_connector, base);
 	struct i2c_adapter *i2c_bus;
@@ -434,7 +437,7 @@ int via_vt1632_mode_valid(struct drm_connector *connector,
 	uint32_t low_freq_limit, high_freq_limit;
 	int ret;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -456,8 +459,8 @@ int via_vt1632_mode_valid(struct drm_connector *connector,
 	low_freq_limit = buf * 1000;
 	via_i2c_readbytes(i2c_bus, 0x08, 0x07, &buf, 1);
 	high_freq_limit = (buf + 65) * 1000;
-	DRM_DEBUG_KMS("Low Frequency Limit: %u KHz\n", low_freq_limit);
-	DRM_DEBUG_KMS("High Frequency Limit: %u KHz\n", high_freq_limit);
+	drm_dbg_kms(dev, "Low Frequency Limit: %u KHz\n", low_freq_limit);
+	drm_dbg_kms(dev, "High Frequency Limit: %u KHz\n", high_freq_limit);
 
 	if (mode->clock < low_freq_limit) {
 		ret = MODE_CLOCK_LOW;
@@ -471,19 +474,20 @@ int via_vt1632_mode_valid(struct drm_connector *connector,
 
 	ret = MODE_OK;
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 static int via_vt1632_get_modes(struct drm_connector *connector)
 {
+	struct drm_device *dev = connector->dev;
 	struct via_connector *con = container_of(connector,
 					struct via_connector, base);
 	int count = 0;
 	struct i2c_adapter *i2c_bus;
 	struct edid *edid = NULL;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -505,14 +509,14 @@ static int via_vt1632_get_modes(struct drm_connector *connector)
 		if (edid->input & DRM_EDID_INPUT_DIGITAL) {
 			drm_connector_update_edid_property(connector, edid);
 			count = drm_add_edid_modes(connector, edid);
-			DRM_DEBUG_KMS("DVI EDID information was obtained.\n");
+			drm_dbg_kms(dev, "DVI EDID information was obtained.\n");
 		}
 
 		kfree(edid);
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return count;
 }
 
@@ -529,21 +533,21 @@ bool via_vt1632_probe(struct drm_device *dev,
 	u16 vendor_id, device_id, revision;
 	bool device_detected = false;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_i2c_readbytes(i2c_bus, 0x08, 0x00, &buf, 1);
 	vendor_id = buf;
 	via_i2c_readbytes(i2c_bus, 0x08, 0x01, &buf, 1);
 	vendor_id |= (buf << 8);
-	DRM_DEBUG_KMS("Vendor ID: %x\n", vendor_id);
+	drm_dbg_kms(dev, "Vendor ID: %x\n", vendor_id);
 	via_i2c_readbytes(i2c_bus, 0x08, 0x02, &buf, 1);
 	device_id = buf;
 	via_i2c_readbytes(i2c_bus, 0x08, 0x03, &buf, 1);
 	device_id |= (buf << 8);
-	DRM_DEBUG_KMS("Device ID: %x\n", device_id);
+	drm_dbg_kms(dev, "Device ID: %x\n", device_id);
 	via_i2c_readbytes(i2c_bus, 0x08, 0x04, &buf, 1);
 	revision = buf;
-	DRM_DEBUG_KMS("Revision: %x\n", revision);
+	drm_dbg_kms(dev, "Revision: %x\n", revision);
 
 	if ((vendor_id != 0x1106) || (device_id != 0x3192)) {
 		goto exit;
@@ -551,7 +555,7 @@ bool via_vt1632_probe(struct drm_device *dev,
 
 	device_detected = true;
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return device_detected;
 }
 
@@ -561,7 +565,7 @@ void via_vt1632_init(struct drm_device *dev)
 	struct via_encoder *enc;
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (!dev_priv->ext_tmds_presence) {
 		goto exit;
@@ -605,5 +609,5 @@ void via_vt1632_init(struct drm_device *dev)
 	INIT_LIST_HEAD(&con->props);
 	drm_connector_attach_encoder(&con->base, &enc->base);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit c6884f8a720ef7fd42e6b9a4a8632110e4750103
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:43:55 2023 -0700

    drm/via: Add drm_device argument to some functions inside via_vt1632.c
    
    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 72f257b51407..4e603f34c8c3 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -368,7 +368,8 @@ void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
 int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index);
 
 void via_dac_probe(struct drm_device *dev);
-bool via_vt1632_probe(struct i2c_adapter *i2c_bus);
+bool via_vt1632_probe(struct drm_device *dev,
+			struct i2c_adapter *i2c_bus);
 bool via_sii164_probe(struct drm_device *dev,
 			struct i2c_adapter *i2c_bus);
 void via_ext_dvi_probe(struct drm_device *dev);
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index c02bde3a8ad8..948a47d1314e 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -603,7 +603,7 @@ void via_ext_dvi_probe(struct drm_device *dev)
 	if ((!dev_priv->ext_tmds_presence) &&
 		(!(dev_priv->mapped_i2c_bus & VIA_I2C_BUS2))) {
 		i2c_bus = via_find_ddc_bus(0x31);
-		if (via_vt1632_probe(i2c_bus)) {
+		if (via_vt1632_probe(dev, i2c_bus)) {
 			dev_priv->ext_tmds_presence = true;
 			dev_priv->ext_tmds_i2c_bus = VIA_I2C_BUS2;
 			dev_priv->ext_tmds_transmitter = VIA_TMDS_VT1632;
@@ -619,7 +619,7 @@ void via_ext_dvi_probe(struct drm_device *dev)
 	if ((!(dev_priv->ext_tmds_presence)) &&
 		(!(dev_priv->mapped_i2c_bus & VIA_I2C_BUS4))) {
 		i2c_bus = via_find_ddc_bus(0x2c);
-		if (via_vt1632_probe(i2c_bus)) {
+		if (via_vt1632_probe(dev, i2c_bus)) {
 			dev_priv->ext_tmds_presence = true;
 			dev_priv->ext_tmds_i2c_bus = VIA_I2C_BUS4;
 			dev_priv->ext_tmds_transmitter = VIA_TMDS_VT1632;
diff --git a/drivers/gpu/drm/via/via_vt1632.c b/drivers/gpu/drm/via/via_vt1632.c
index 9437ef4d2501..663fea639d57 100644
--- a/drivers/gpu/drm/via/via_vt1632.c
+++ b/drivers/gpu/drm/via/via_vt1632.c
@@ -44,7 +44,9 @@
 #define VIA_VT1632_PDB		BIT(0)
 
 
-static void via_vt1632_power(struct i2c_adapter *i2c_bus, bool power_state)
+static void via_vt1632_power(struct drm_device *dev,
+				struct i2c_adapter *i2c_bus,
+				bool power_state)
 {
 	u8 buf;
 	u8 power_bit;
@@ -63,7 +65,8 @@ static void via_vt1632_power(struct i2c_adapter *i2c_bus, bool power_state)
 }
 
 
-static bool via_vt1632_sense(struct i2c_adapter *i2c_bus)
+static bool via_vt1632_sense(struct drm_device *dev,
+				struct i2c_adapter *i2c_bus)
 {
 	u8 buf;
 	bool rx_detected = false;
@@ -82,7 +85,8 @@ static bool via_vt1632_sense(struct i2c_adapter *i2c_bus)
 	return rx_detected;
 }
 
-static void via_vt1632_display_registers(struct i2c_adapter *i2c_bus)
+static void via_vt1632_display_registers(struct drm_device *dev,
+					struct i2c_adapter *i2c_bus)
 {
 	uint8_t i;
 	u8 buf;
@@ -98,7 +102,8 @@ static void via_vt1632_display_registers(struct i2c_adapter *i2c_bus)
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_vt1632_init_registers(struct i2c_adapter *i2c_bus)
+static void via_vt1632_init_registers(struct drm_device *dev,
+					struct i2c_adapter *i2c_bus)
 {
 	u8 buf;
 
@@ -175,16 +180,16 @@ static void via_vt1632_dpms(struct drm_encoder *encoder, int mode)
 		goto exit;
 	}
 
-	via_vt1632_display_registers(i2c_bus);
+	via_vt1632_display_registers(dev, i2c_bus);
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
-		via_vt1632_power(i2c_bus, true);
+		via_vt1632_power(dev, i2c_bus, true);
 		via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		via_vt1632_power(i2c_bus, false);
+		via_vt1632_power(dev, i2c_bus, false);
 		via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 		break;
 	default:
@@ -244,9 +249,9 @@ static void via_vt1632_mode_set(struct drm_encoder *encoder,
 		via_clock_source(dev_priv, enc->di_port, true);
 	}
 
-	via_vt1632_display_registers(i2c_bus);
-	via_vt1632_init_registers(i2c_bus);
-	via_vt1632_display_registers(i2c_bus);
+	via_vt1632_display_registers(dev, i2c_bus);
+	via_vt1632_init_registers(dev, i2c_bus);
+	via_vt1632_display_registers(dev, i2c_bus);
 
 	via_transmitter_display_source(dev_priv, enc->di_port, iga->index);
 exit:
@@ -280,7 +285,7 @@ static void via_vt1632_prepare(struct drm_encoder *encoder)
 		goto exit;
 	}
 
-	via_vt1632_power(i2c_bus, false);
+	via_vt1632_power(dev, i2c_bus, false);
 	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
 		via_output_enable(dev_priv, enc->di_port, false);
@@ -316,7 +321,7 @@ static void via_vt1632_commit(struct drm_encoder *encoder)
 		goto exit;
 	}
 
-	via_vt1632_power(i2c_bus, true);
+	via_vt1632_power(dev, i2c_bus, true);
 	via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
 		via_output_enable(dev_priv, enc->di_port, true);
@@ -351,7 +356,7 @@ static void via_vt1632_disable(struct drm_encoder *encoder)
 		goto exit;
 	}
 
-	via_vt1632_power(i2c_bus, false);
+	via_vt1632_power(dev, i2c_bus, false);
 	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -373,6 +378,7 @@ static enum drm_connector_status via_vt1632_detect(
 					struct drm_connector *connector,
 					bool force)
 {
+	struct drm_device *dev = connector->dev;
 	struct via_connector *con = container_of(connector,
 					struct via_connector, base);
 	struct i2c_adapter *i2c_bus;
@@ -395,7 +401,7 @@ static enum drm_connector_status via_vt1632_detect(
 		goto exit;
 	}
 
-	if (via_vt1632_sense(i2c_bus)) {
+	if (via_vt1632_sense(dev, i2c_bus)) {
 		ret = connector_status_connected;
 		DRM_DEBUG_KMS("DVI detected.\n");
 	}
@@ -516,7 +522,8 @@ via_vt1632_drm_connector_helper_funcs = {
 	.get_modes = via_vt1632_get_modes,
 };
 
-bool via_vt1632_probe(struct i2c_adapter *i2c_bus)
+bool via_vt1632_probe(struct drm_device *dev,
+			struct i2c_adapter *i2c_bus)
 {
 	u8 buf;
 	u16 vendor_id, device_id, revision;
commit 5770fda89e55395ff23e6f89d8abf4b7ee17fbcf
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:42:37 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_ttm.c
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_ttm.c b/drivers/gpu/drm/via/via_ttm.c
index bc1d6465a365..d62831e76819 100644
--- a/drivers/gpu/drm/via/via_ttm.c
+++ b/drivers/gpu/drm/via/via_ttm.c
@@ -42,9 +42,11 @@
 static void via_bo_move_notify(struct ttm_buffer_object *bo, bool evict,
 				struct ttm_resource *new_mem)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	struct drm_device *dev = bo->base.dev;
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
+
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return;
 }
 
@@ -78,9 +80,10 @@ static void via_ttm_tt_destroy(struct ttm_device *bdev, struct ttm_tt *tt)
 static void via_bo_evict_flags(struct ttm_buffer_object *bo,
 				struct ttm_placement *placement)
 {
+	struct drm_device *dev = bo->base.dev;
 	struct via_bo *driver_bo = to_ttm_bo(bo);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (bo->destroy == &via_ttm_bo_destroy) {
 		goto exit;
@@ -97,7 +100,7 @@ static void via_bo_evict_flags(struct ttm_buffer_object *bo,
 
 	*placement = driver_bo->placement;
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static int via_bo_move(struct ttm_buffer_object *bo, bool evict,
@@ -131,11 +134,13 @@ static int via_bo_move(struct ttm_buffer_object *bo, bool evict,
 
 static void via_bo_delete_mem_notify(struct ttm_buffer_object *bo)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	struct drm_device *dev = bo->base.dev;
+
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_bo_move_notify(bo, false, NULL);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return;
 }
 
@@ -144,9 +149,10 @@ static int via_bo_io_mem_reserve(struct ttm_device *bdev,
 {
 	struct via_drm_priv *dev_priv = container_of(bdev,
 						struct via_drm_priv, bdev);
+	struct drm_device *dev = &dev_priv->dev;
 	int ret = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch (mem->mem_type) {
 	case TTM_PL_SYSTEM:
@@ -161,7 +167,7 @@ static int via_bo_io_mem_reserve(struct ttm_device *bdev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
commit 6a7a8d68052ff03df81d18e6b7b49d9db1720318
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:35:08 2023 -0700

    drm/via: Convert to drm_dbg_driver() for via_tmds.c
    
    Discontinue the use of DRM_INFO().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 9e8031d06921..c02bde3a8ad8 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -52,7 +52,7 @@ static void via_tmds_power(struct drm_device *dev, bool power_state)
 		via_lvds1_set_soft_display_period(VGABASE, false);
 	}
 
-	DRM_INFO("DVI Power: %s\n",
+	drm_dbg_driver(dev, "DVI Power: %s\n",
 			power_state ? "On" : "Off");
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
@@ -173,9 +173,9 @@ static void via_tmds_sync_polarity(struct drm_device *dev,
 	}
 
 	via_tmds_set_sync_polarity(VGABASE, syncPolarity);
-	DRM_INFO("TMDS (DVI) Horizontal Sync Polarity: %s\n",
+	drm_dbg_driver(dev, "TMDS (DVI) Horizontal Sync Polarity: %s\n",
 		(syncPolarity & BIT(0)) ? "-" : "+");
-	DRM_INFO("TMDS (DVI) Vertical Sync Polarity: %s\n",
+	drm_dbg_driver(dev, "TMDS (DVI) Vertical Sync Polarity: %s\n",
 		(syncPolarity & BIT(1)) ? "-" : "+");
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
@@ -192,7 +192,7 @@ static void via_tmds_display_source(struct drm_device *dev, int index)
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_tmds_set_display_source(VGABASE, displaySource & 0x01);
-	DRM_INFO("TMDS (DVI) Display Source: IGA%d\n",
+	drm_dbg_driver(dev, "TMDS (DVI) Display Source: IGA%d\n",
 			(displaySource & 0x01) + 1);
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
commit 361b21588325fb3da0a539e50abb20a090f76c4e
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:35:06 2023 -0700

    drm/via: Convert to drm_err() for via_tmds.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 2bbb97712d3b..9e8031d06921 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -225,7 +225,7 @@ static void via_tmds_dpms(struct drm_encoder *encoder, int mode)
 		via_tmds_io_pad_setting(dev, enc->di_port, false);
 		break;
 	default:
-		DRM_ERROR("Bad DPMS mode.");
+		drm_err(dev, "Bad DPMS mode.");
 		break;
 	}
 
@@ -549,7 +549,7 @@ void via_tmds_init(struct drm_device *dev)
 
 	enc = kzalloc(sizeof(*enc) + sizeof(*con), GFP_KERNEL);
 	if (!enc) {
-		DRM_ERROR("Failed to allocate connector "
+		drm_err(dev, "Failed to allocate connector "
 				"and encoder.\n");
 		goto exit;
 	}
commit 2aa2bfb323ae3e4f48f8f7c7d95583633732f323
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:35:04 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_tmds.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 32d6a0b4eb0d..2bbb97712d3b 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -40,7 +40,7 @@ static void via_tmds_power(struct drm_device *dev, bool power_state)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (power_state) {
 		via_lvds1_set_soft_display_period(VGABASE, true);
@@ -55,7 +55,7 @@ static void via_tmds_power(struct drm_device *dev, bool power_state)
 	DRM_INFO("DVI Power: %s\n",
 			power_state ? "On" : "Off");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_tmds_io_pad_setting(struct drm_device *dev,
@@ -63,7 +63,7 @@ static void via_tmds_io_pad_setting(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_TMDS:
@@ -74,9 +74,9 @@ static void via_tmds_io_pad_setting(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("DVI I/O Pad: %s\n", io_pad_on ? "On": "Off");
+	drm_dbg_kms(dev, "DVI I/O Pad: %s\n", io_pad_on ? "On": "Off");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -88,7 +88,7 @@ static void via_tmds_init_reg(struct drm_device *dev)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/* Turn off hardware controlled FP power on / off circuit. */
 	via_lvds_set_primary_hard_power(VGABASE, false);
@@ -149,7 +149,7 @@ static void via_tmds_init_reg(struct drm_device *dev)
 	 *             (This bit has a RW1C attribute.) */
 	svga_wseq_mask(VGABASE, 0x2b, 0x40, 0x40);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -162,7 +162,7 @@ static void via_tmds_sync_polarity(struct drm_device *dev,
 
 	u8 syncPolarity = 0x00;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (flags & DRM_MODE_FLAG_NHSYNC) {
 		syncPolarity |= BIT(0);
@@ -178,7 +178,7 @@ static void via_tmds_sync_polarity(struct drm_device *dev,
 	DRM_INFO("TMDS (DVI) Vertical Sync Polarity: %s\n",
 		(syncPolarity & BIT(1)) ? "-" : "+");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -189,13 +189,13 @@ static void via_tmds_display_source(struct drm_device *dev, int index)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 displaySource = index;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_tmds_set_display_source(VGABASE, displaySource & 0x01);
 	DRM_INFO("TMDS (DVI) Display Source: IGA%d\n",
 			(displaySource & 0x01) + 1);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -211,7 +211,7 @@ static void via_tmds_dpms(struct drm_encoder *encoder, int mode)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
@@ -229,7 +229,7 @@ static void via_tmds_dpms(struct drm_encoder *encoder, int mode)
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /* Pass our mode to the connectors and the CRTC to give them a chance to
@@ -250,12 +250,12 @@ static void via_tmds_prepare(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_tmds_power(dev, false);
 	via_tmds_io_pad_setting(dev, enc->di_port, false);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_tmds_commit(struct drm_encoder *encoder)
@@ -264,12 +264,12 @@ static void via_tmds_commit(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_tmds_power(dev, true);
 	via_tmds_io_pad_setting(dev, enc->di_port, true);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -283,13 +283,13 @@ static void via_tmds_mode_set(struct drm_encoder *encoder,
 	struct via_crtc *iga = container_of(encoder->crtc,
 						struct via_crtc, base);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_tmds_init_reg(dev);
 	via_tmds_sync_polarity(dev, adjusted_mode->flags);
 	via_tmds_display_source(dev, iga->index);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_tmds_disable(struct drm_encoder *encoder)
@@ -298,12 +298,12 @@ static void via_tmds_disable(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_tmds_power(dev, false);
 	via_tmds_io_pad_setting(dev, enc->di_port, false);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static const struct drm_encoder_helper_funcs
@@ -320,12 +320,14 @@ static enum drm_connector_status via_tmds_detect(
 					struct drm_connector *connector,
 					bool force)
 {
+	struct drm_device *dev = connector->dev;
+
 	struct via_connector *con = container_of(connector, struct via_connector, base);
 	enum drm_connector_status ret = connector_status_disconnected;
 	struct i2c_adapter *i2c_bus;
 	struct edid *edid = NULL;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS2) {
 		i2c_bus = via_find_ddc_bus(0x31);
@@ -347,7 +349,7 @@ static enum drm_connector_status via_tmds_detect(
 		}
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -372,7 +374,7 @@ static enum drm_mode_status via_tmds_mode_valid(
 	int min_clock, max_clock;
 	enum drm_mode_status status = MODE_OK;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	min_clock = 25000;
 	switch (pdev->device) {
@@ -409,19 +411,20 @@ static enum drm_mode_status via_tmds_mode_valid(
 	}
 
 exit:
-	DRM_DEBUG_KMS("status: %u\n", status);
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "status: %u\n", status);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return status;
 }
 
 static int via_tmds_get_modes(struct drm_connector *connector)
 {
+	struct drm_device *dev = connector->dev;
 	struct via_connector *con = container_of(connector, struct via_connector, base);
 	struct i2c_adapter *i2c_bus;
 	struct edid *edid = NULL;
 	int count = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS2) {
 		i2c_bus = via_find_ddc_bus(0x31);
@@ -437,13 +440,13 @@ static int via_tmds_get_modes(struct drm_connector *connector)
 			drm_connector_update_edid_property(connector,
 								edid);
 			count = drm_add_edid_modes(connector, edid);
-			DRM_DEBUG_KMS("DVI EDID information was obtained.\n");
+			drm_dbg_kms(dev, "DVI EDID information was obtained.\n");
 		}
 
 		kfree(edid);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return count;
 }
 
@@ -462,7 +465,7 @@ void via_tmds_probe(struct drm_device *dev)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 sr13, sr5a;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/* Detect the presence of integrated TMDS transmitter. */
 	switch (pdev->device) {
@@ -476,7 +479,7 @@ void via_tmds_probe(struct drm_device *dev)
 		svga_wseq_mask(VGABASE, 0x5a, BIT(0), BIT(0));
 
 		sr13 = vga_rseq(VGABASE, 0x13);
-		DRM_DEBUG_KMS("sr13: 0x%02x\n", sr13);
+		drm_dbg_kms(dev, "sr13: 0x%02x\n", sr13);
 
 		vga_wseq(VGABASE, 0x5a, sr5a);
 
@@ -495,7 +498,7 @@ void via_tmds_probe(struct drm_device *dev)
 			dev_priv->int_tmds_di_port = VIA_DI_PORT_TMDS;
 			dev_priv->int_tmds_i2c_bus = VIA_I2C_BUS2;
 			dev_priv->mapped_i2c_bus |= VIA_I2C_BUS2;
-			DRM_DEBUG_KMS("Integrated TMDS (DVI) "
+			drm_dbg_kms(dev, "Integrated TMDS (DVI) "
 					"transmitter detected.\n");
 		} else if (((!(sr13 & BIT(7))) && (sr13 & BIT(6))) ||
 				((sr13 & BIT(7)) && (sr13 & BIT(6)))) {
@@ -503,7 +506,7 @@ void via_tmds_probe(struct drm_device *dev)
 			dev_priv->int_tmds_di_port = VIA_DI_PORT_TMDS;
 			dev_priv->int_tmds_i2c_bus = VIA_I2C_BUS2;
 			dev_priv->mapped_i2c_bus |= VIA_I2C_BUS2;
-			DRM_DEBUG_KMS("Integrated TMDS (DVI) "
+			drm_dbg_kms(dev, "Integrated TMDS (DVI) "
 					"transmitter detected via pin "
 					"strapping.\n");
 		} else {
@@ -520,16 +523,16 @@ void via_tmds_probe(struct drm_device *dev)
 		break;
 	}
 
-	DRM_DEBUG_KMS("int_tmds_presence: %x\n",
+	drm_dbg_kms(dev, "int_tmds_presence: %x\n",
 			dev_priv->int_tmds_presence);
-	DRM_DEBUG_KMS("int_tmds_di_port: 0x%08x\n",
+	drm_dbg_kms(dev, "int_tmds_di_port: 0x%08x\n",
 			dev_priv->int_tmds_di_port);
-	DRM_DEBUG_KMS("int_tmds_i2c_bus: 0x%08x\n",
+	drm_dbg_kms(dev, "int_tmds_i2c_bus: 0x%08x\n",
 			dev_priv->int_tmds_i2c_bus);
-	DRM_DEBUG_KMS("mapped_i2c_bus: 0x%08x\n",
+	drm_dbg_kms(dev, "mapped_i2c_bus: 0x%08x\n",
 			dev_priv->mapped_i2c_bus);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_tmds_init(struct drm_device *dev)
@@ -538,7 +541,7 @@ void via_tmds_init(struct drm_device *dev)
 	struct via_connector *con;
 	struct via_encoder *enc;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (!dev_priv->int_tmds_presence) {
 		goto exit;
@@ -578,7 +581,7 @@ void via_tmds_init(struct drm_device *dev)
 
 	drm_connector_attach_encoder(&con->base, &enc->base);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -591,7 +594,7 @@ void via_ext_dvi_probe(struct drm_device *dev)
 	struct i2c_adapter *i2c_bus;
 	u8 sr12, sr13;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	dev_priv->ext_tmds_presence = false;
 	dev_priv->ext_tmds_i2c_bus = VIA_I2C_NONE;
@@ -631,8 +634,8 @@ void via_ext_dvi_probe(struct drm_device *dev)
 
 	sr12 = vga_rseq(VGABASE, 0x12);
 	sr13 = vga_rseq(VGABASE, 0x13);
-	DRM_DEBUG_KMS("SR12: 0x%02x\n", sr12);
-	DRM_DEBUG_KMS("SR13: 0x%02x\n", sr13);
+	drm_dbg_kms(dev, "SR12: 0x%02x\n", sr12);
+	drm_dbg_kms(dev, "SR13: 0x%02x\n", sr13);
 
 	if (dev_priv->ext_tmds_presence) {
 		switch (pdev->device) {
@@ -702,15 +705,15 @@ void via_ext_dvi_probe(struct drm_device *dev)
 		}
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_ext_dvi_init(struct drm_device *dev)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_vt1632_init(dev);
 	via_sii164_init(dev);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit d7623c8b7ba208c70b7c4a6320db4c5264670376
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:35:02 2023 -0700

    drm/via: Use drm_device for function argument inside via_tmds.c
    
    Obtain a pointer to via_drm_priv via drm_device.
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index be502e7aeb72..32d6a0b4eb0d 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -36,9 +36,10 @@
 #include "via_drv.h"
 
 
-static void via_tmds_power(struct via_drm_priv *dev_priv,
-				bool power_state)
+static void via_tmds_power(struct drm_device *dev, bool power_state)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	if (power_state) {
@@ -57,9 +58,11 @@ static void via_tmds_power(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_tmds_io_pad_setting(struct via_drm_priv *dev_priv,
+static void via_tmds_io_pad_setting(struct drm_device *dev,
 					u32 di_port, bool io_pad_on)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch(di_port) {
@@ -81,8 +84,10 @@ static void via_tmds_io_pad_setting(struct via_drm_priv *dev_priv,
  * integrated TMDS transmitter. Synchronization polarity and
  * display output source need to be set separately.
  */
-static void via_tmds_init_reg(struct via_drm_priv *dev_priv)
+static void via_tmds_init_reg(struct drm_device *dev)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	/* Turn off hardware controlled FP power on / off circuit. */
@@ -150,9 +155,11 @@ static void via_tmds_init_reg(struct via_drm_priv *dev_priv)
 /*
  * Set TMDS (DVI) sync polarity.
  */
-static void via_tmds_sync_polarity(struct via_drm_priv *dev_priv,
+static void via_tmds_sync_polarity(struct drm_device *dev,
 					unsigned int flags)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	u8 syncPolarity = 0x00;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -177,9 +184,9 @@ static void via_tmds_sync_polarity(struct via_drm_priv *dev_priv,
 /*
  * Sets TMDS (DVI) display source.
  */
-static void via_tmds_display_source(struct via_drm_priv *dev_priv,
-					int index)
+static void via_tmds_display_source(struct drm_device *dev, int index)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 displaySource = index;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -203,20 +210,19 @@ static void via_tmds_dpms(struct drm_encoder *encoder, int mode)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
-		via_tmds_power(dev_priv, true);
-		via_tmds_io_pad_setting(dev_priv, enc->di_port, true);
+		via_tmds_power(dev, true);
+		via_tmds_io_pad_setting(dev, enc->di_port, true);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		via_tmds_power(dev_priv, false);
-		via_tmds_io_pad_setting(dev_priv, enc->di_port, false);
+		via_tmds_power(dev, false);
+		via_tmds_io_pad_setting(dev, enc->di_port, false);
 		break;
 	default:
 		DRM_ERROR("Bad DPMS mode.");
@@ -243,12 +249,11 @@ static void via_tmds_prepare(struct drm_encoder *encoder)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_tmds_power(dev_priv, false);
-	via_tmds_io_pad_setting(dev_priv, enc->di_port, false);
+	via_tmds_power(dev, false);
+	via_tmds_io_pad_setting(dev, enc->di_port, false);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
@@ -258,12 +263,11 @@ static void via_tmds_commit(struct drm_encoder *encoder)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_tmds_power(dev_priv, true);
-	via_tmds_io_pad_setting(dev_priv, enc->di_port, true);
+	via_tmds_power(dev, true);
+	via_tmds_io_pad_setting(dev, enc->di_port, true);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
@@ -276,15 +280,14 @@ static void via_tmds_mode_set(struct drm_encoder *encoder,
 				struct drm_display_mode *adjusted_mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct via_crtc *iga = container_of(encoder->crtc,
 						struct via_crtc, base);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_tmds_init_reg(dev_priv);
-	via_tmds_sync_polarity(dev_priv, adjusted_mode->flags);
-	via_tmds_display_source(dev_priv, iga->index);
+	via_tmds_init_reg(dev);
+	via_tmds_sync_polarity(dev, adjusted_mode->flags);
+	via_tmds_display_source(dev, iga->index);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
@@ -294,12 +297,11 @@ static void via_tmds_disable(struct drm_encoder *encoder)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_tmds_power(dev_priv, false);
-	via_tmds_io_pad_setting(dev_priv, enc->di_port, false);
+	via_tmds_power(dev, false);
+	via_tmds_io_pad_setting(dev, enc->di_port, false);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
commit e1596bc99c2271260c9f0d3cf7da641c8fef7b05
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:33:28 2023 -0700

    drm/via: Convert to drm_err() for via_sii164.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_sii164.c b/drivers/gpu/drm/via/via_sii164.c
index 7b5a05a54d67..2ff0bbeff863 100644
--- a/drivers/gpu/drm/via/via_sii164.c
+++ b/drivers/gpu/drm/via/via_sii164.c
@@ -173,7 +173,7 @@ static void via_sii164_dpms(struct drm_encoder *encoder, int mode)
 		via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 		break;
 	default:
-		DRM_ERROR("Bad DPMS mode.");
+		drm_err(dev, "Bad DPMS mode.");
 		break;
 	}
 
@@ -553,7 +553,7 @@ void via_sii164_init(struct drm_device *dev)
 
 	enc = kzalloc(sizeof(*enc) + sizeof(*con), GFP_KERNEL);
 	if (!enc) {
-		DRM_ERROR("Failed to allocate connector "
+		drm_err(dev, "Failed to allocate connector "
 				"and encoder.\n");
 		goto exit;
 	}
commit d9b45d89f173e7cc992ba15a354b4e8d6d495d34
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:33:26 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_sii164.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_sii164.c b/drivers/gpu/drm/via/via_sii164.c
index 4c1191df335b..7b5a05a54d67 100644
--- a/drivers/gpu/drm/via/via_sii164.c
+++ b/drivers/gpu/drm/via/via_sii164.c
@@ -51,17 +51,17 @@ static void via_sii164_power(struct drm_device *dev,
 	u8 buf;
 	u8 power_bit;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_i2c_readbytes(i2c_bus, 0x38, 0x08, &buf, 1);
 	power_bit = power_state ? SII164_PDB : 0x00;
 	buf &= ~power_bit;
 	buf |= power_bit;
 	via_i2c_writebytes(i2c_bus, 0x38, 0x08, &buf, 1);
-	DRM_DEBUG_KMS("SiI 164 (DVI) Power: %s\n",
+	drm_dbg_kms(dev, "SiI 164 (DVI) Power: %s\n",
 			power_state ? "On" : "Off");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 
@@ -71,17 +71,17 @@ static bool via_sii164_sense(struct drm_device *dev,
 	u8 buf;
 	bool rx_detected = false;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_i2c_readbytes(i2c_bus, 0x38, 0x09, &buf, 1);
 	if (buf & BIT(2)) {
 		rx_detected = true;
 	}
 
-	DRM_DEBUG_KMS("SiI 164 (DVI) Connector Sense: %s\n",
+	drm_dbg_kms(dev, "SiI 164 (DVI) Connector Sense: %s\n",
 			rx_detected ? "Connected" : "Not Connected");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return rx_detected;
 }
 
@@ -91,15 +91,15 @@ static void via_sii164_display_registers(struct drm_device *dev,
 	uint8_t i;
 	u8 buf;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
-	DRM_DEBUG_KMS("SiI 164 Registers:\n");
+	drm_dbg_kms(dev, "SiI 164 Registers:\n");
 	for (i = 0; i < 0x10; i++) {
 		via_i2c_readbytes(i2c_bus, 0x38, i, &buf, 1);
-		DRM_DEBUG_KMS("0x%02x: 0x%02x\n", i, buf);
+		drm_dbg_kms(dev, "0x%02x: 0x%02x\n", i, buf);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_sii164_init_registers(struct drm_device *dev,
@@ -107,7 +107,7 @@ static void via_sii164_init_registers(struct drm_device *dev,
 {
 	u8 buf;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	buf = SII164_VEN | SII164_HEN |
 		SII164_DSEL |
@@ -127,7 +127,7 @@ static void via_sii164_init_registers(struct drm_device *dev,
 	buf = 0x89;
 	via_i2c_writebytes(i2c_bus, 0x38, 0x0c, &buf, 1);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 
@@ -143,7 +143,7 @@ static void via_sii164_dpms(struct drm_encoder *encoder, int mode)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -178,18 +178,20 @@ static void via_sii164_dpms(struct drm_encoder *encoder, int mode)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static bool via_sii164_mode_fixup(struct drm_encoder *encoder,
 				const struct drm_display_mode *mode,
 				struct drm_display_mode *adjusted_mode)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	struct drm_device *dev = encoder->dev;
+
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	drm_mode_set_crtcinfo(adjusted_mode, 0);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return true;
 }
 
@@ -205,7 +207,7 @@ static void via_sii164_mode_set(struct drm_encoder *encoder,
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -236,7 +238,7 @@ static void via_sii164_mode_set(struct drm_encoder *encoder,
 	via_transmitter_display_source(dev_priv, enc->di_port, iga->index);
 exit:
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_sii164_prepare(struct drm_encoder *encoder)
@@ -248,7 +250,7 @@ static void via_sii164_prepare(struct drm_encoder *encoder)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -272,7 +274,7 @@ static void via_sii164_prepare(struct drm_encoder *encoder)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_sii164_commit(struct drm_encoder *encoder)
@@ -284,7 +286,7 @@ static void via_sii164_commit(struct drm_encoder *encoder)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -308,7 +310,7 @@ static void via_sii164_commit(struct drm_encoder *encoder)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_sii164_disable(struct drm_encoder *encoder)
@@ -319,7 +321,7 @@ static void via_sii164_disable(struct drm_encoder *encoder)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct i2c_adapter *i2c_bus;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (enc->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -339,7 +341,7 @@ static void via_sii164_disable(struct drm_encoder *encoder)
 	via_sii164_power(dev, i2c_bus, false);
 	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 
@@ -364,7 +366,7 @@ static enum drm_connector_status via_sii164_detect(
 	struct i2c_adapter *i2c_bus;
 	enum drm_connector_status ret = connector_status_disconnected;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -383,11 +385,11 @@ static enum drm_connector_status via_sii164_detect(
 
 	if (via_sii164_sense(dev, i2c_bus)) {
 		ret = connector_status_connected;
-		DRM_DEBUG_KMS("DVI detected.\n");
+		drm_dbg_kms(dev, "DVI detected.\n");
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -407,6 +409,7 @@ static const struct drm_connector_funcs via_sii164_drm_connector_funcs = {
 int via_sii164_mode_valid(struct drm_connector *connector,
 					struct drm_display_mode *mode)
 {
+	struct drm_device *dev = connector->dev;
 	struct via_connector *con = container_of(connector,
 					struct via_connector, base);
 	struct i2c_adapter *i2c_bus;
@@ -414,7 +417,7 @@ int via_sii164_mode_valid(struct drm_connector *connector,
 	uint32_t low_freq_limit, high_freq_limit;
 	int ret;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -436,8 +439,8 @@ int via_sii164_mode_valid(struct drm_connector *connector,
 	low_freq_limit = buf * 1000;
 	via_i2c_readbytes(i2c_bus, 0x38, 0x07, &buf, 1);
 	high_freq_limit = (buf + 65) * 1000;
-	DRM_DEBUG_KMS("Low Frequency Limit: %u KHz\n", low_freq_limit);
-	DRM_DEBUG_KMS("High Frequency Limit: %u KHz\n", high_freq_limit);
+	drm_dbg_kms(dev, "Low Frequency Limit: %u KHz\n", low_freq_limit);
+	drm_dbg_kms(dev, "High Frequency Limit: %u KHz\n", high_freq_limit);
 
 	if (mode->clock < low_freq_limit) {
 		ret = MODE_CLOCK_LOW;
@@ -451,19 +454,20 @@ int via_sii164_mode_valid(struct drm_connector *connector,
 
 	ret = MODE_OK;
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 static int via_sii164_get_modes(struct drm_connector *connector)
 {
+	struct drm_device *dev = connector->dev;
 	struct via_connector *con = container_of(connector,
 					struct via_connector, base);
 	int count = 0;
 	struct i2c_adapter *i2c_bus;
 	struct edid *edid = NULL;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -485,14 +489,14 @@ static int via_sii164_get_modes(struct drm_connector *connector)
 		if (edid->input & DRM_EDID_INPUT_DIGITAL) {
 			drm_connector_update_edid_property(connector, edid);
 			count = drm_add_edid_modes(connector, edid);
-			DRM_DEBUG_KMS("DVI EDID information was obtained.\n");
+			drm_dbg_kms(dev, "DVI EDID information was obtained.\n");
 		}
 
 		kfree(edid);
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return count;
 }
 
@@ -509,21 +513,21 @@ bool via_sii164_probe(struct drm_device *dev,
 	u16 vendor_id, device_id, revision;
 	bool device_detected = false;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_i2c_readbytes(i2c_bus, 0x38, 0x00, &buf, 1);
 	vendor_id = buf;
 	via_i2c_readbytes(i2c_bus, 0x38, 0x01, &buf, 1);
 	vendor_id |= (buf << 8);
-	DRM_DEBUG_KMS("Vendor ID: %x\n", vendor_id);
+	drm_dbg_kms(dev, "Vendor ID: %x\n", vendor_id);
 	via_i2c_readbytes(i2c_bus, 0x38, 0x02, &buf, 1);
 	device_id = buf;
 	via_i2c_readbytes(i2c_bus, 0x38, 0x03, &buf, 1);
 	device_id |= (buf << 8);
-	DRM_DEBUG_KMS("Device ID: %x\n", device_id);
+	drm_dbg_kms(dev, "Device ID: %x\n", device_id);
 	via_i2c_readbytes(i2c_bus, 0x38, 0x04, &buf, 1);
 	revision = buf;
-	DRM_DEBUG_KMS("Revision: %x\n", revision);
+	drm_dbg_kms(dev, "Revision: %x\n", revision);
 
 	if ((vendor_id != 0x0001) || (device_id != 0x0006)) {
 		goto exit;
@@ -531,7 +535,7 @@ bool via_sii164_probe(struct drm_device *dev,
 
 	device_detected = true;
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return device_detected;
 }
 
@@ -541,7 +545,7 @@ void via_sii164_init(struct drm_device *dev)
 	struct via_encoder *enc;
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (!dev_priv->ext_tmds_presence) {
 		goto exit;
@@ -585,5 +589,5 @@ void via_sii164_init(struct drm_device *dev)
 	INIT_LIST_HEAD(&con->props);
 	drm_connector_attach_encoder(&con->base, &enc->base);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit f574f0a8e2afda2eb0b714dd183e98b46fe7d00e
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:33:25 2023 -0700

    drm/via: Add drm_device argument to some functions inside via_sii164.c
    
    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 5ca883a30df6..72f257b51407 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -369,7 +369,8 @@ int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index);
 
 void via_dac_probe(struct drm_device *dev);
 bool via_vt1632_probe(struct i2c_adapter *i2c_bus);
-bool via_sii164_probe(struct i2c_adapter *i2c_bus);
+bool via_sii164_probe(struct drm_device *dev,
+			struct i2c_adapter *i2c_bus);
 void via_ext_dvi_probe(struct drm_device *dev);
 void via_tmds_probe(struct drm_device *dev);
 void via_lvds_probe(struct drm_device *dev);
diff --git a/drivers/gpu/drm/via/via_sii164.c b/drivers/gpu/drm/via/via_sii164.c
index 89461b9b7412..4c1191df335b 100644
--- a/drivers/gpu/drm/via/via_sii164.c
+++ b/drivers/gpu/drm/via/via_sii164.c
@@ -44,7 +44,9 @@
 #define SII164_PDB		BIT(0)
 
 
-static void via_sii164_power(struct i2c_adapter *i2c_bus, bool power_state)
+static void via_sii164_power(struct drm_device *dev,
+				struct i2c_adapter *i2c_bus,
+				bool power_state)
 {
 	u8 buf;
 	u8 power_bit;
@@ -63,7 +65,8 @@ static void via_sii164_power(struct i2c_adapter *i2c_bus, bool power_state)
 }
 
 
-static bool via_sii164_sense(struct i2c_adapter *i2c_bus)
+static bool via_sii164_sense(struct drm_device *dev,
+				struct i2c_adapter *i2c_bus)
 {
 	u8 buf;
 	bool rx_detected = false;
@@ -82,7 +85,8 @@ static bool via_sii164_sense(struct i2c_adapter *i2c_bus)
 	return rx_detected;
 }
 
-static void via_sii164_display_registers(struct i2c_adapter *i2c_bus)
+static void via_sii164_display_registers(struct drm_device *dev,
+					struct i2c_adapter *i2c_bus)
 {
 	uint8_t i;
 	u8 buf;
@@ -98,7 +102,8 @@ static void via_sii164_display_registers(struct i2c_adapter *i2c_bus)
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_sii164_init_registers(struct i2c_adapter *i2c_bus)
+static void via_sii164_init_registers(struct drm_device *dev,
+					struct i2c_adapter *i2c_bus)
 {
 	u8 buf;
 
@@ -155,16 +160,16 @@ static void via_sii164_dpms(struct drm_encoder *encoder, int mode)
 		goto exit;
 	}
 
-	via_sii164_display_registers(i2c_bus);
+	via_sii164_display_registers(dev, i2c_bus);
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
-		via_sii164_power(i2c_bus, true);
+		via_sii164_power(dev, i2c_bus, true);
 		via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		via_sii164_power(i2c_bus, false);
+		via_sii164_power(dev, i2c_bus, false);
 		via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 		break;
 	default:
@@ -224,9 +229,9 @@ static void via_sii164_mode_set(struct drm_encoder *encoder,
 		via_clock_source(dev_priv, enc->di_port, true);
 	}
 
-	via_sii164_display_registers(i2c_bus);
-	via_sii164_init_registers(i2c_bus);
-	via_sii164_display_registers(i2c_bus);
+	via_sii164_display_registers(dev, i2c_bus);
+	via_sii164_init_registers(dev, i2c_bus);
+	via_sii164_display_registers(dev, i2c_bus);
 
 	via_transmitter_display_source(dev_priv, enc->di_port, iga->index);
 exit:
@@ -260,7 +265,7 @@ static void via_sii164_prepare(struct drm_encoder *encoder)
 		goto exit;
 	}
 
-	via_sii164_power(i2c_bus, false);
+	via_sii164_power(dev, i2c_bus, false);
 	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
 		via_output_enable(dev_priv, enc->di_port, false);
@@ -296,7 +301,7 @@ static void via_sii164_commit(struct drm_encoder *encoder)
 		goto exit;
 	}
 
-	via_sii164_power(i2c_bus, true);
+	via_sii164_power(dev, i2c_bus, true);
 	via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
 	if (pdev->device == PCI_DEVICE_ID_VIA_CLE266_GFX) {
 		via_output_enable(dev_priv, enc->di_port, true);
@@ -331,7 +336,7 @@ static void via_sii164_disable(struct drm_encoder *encoder)
 		goto exit;
 	}
 
-	via_sii164_power(i2c_bus, false);
+	via_sii164_power(dev, i2c_bus, false);
 	via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
 exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -353,6 +358,7 @@ static enum drm_connector_status via_sii164_detect(
 					struct drm_connector *connector,
 					bool force)
 {
+	struct drm_device *dev = connector->dev;
 	struct via_connector *con = container_of(connector,
 					struct via_connector, base);
 	struct i2c_adapter *i2c_bus;
@@ -375,7 +381,7 @@ static enum drm_connector_status via_sii164_detect(
 		goto exit;
 	}
 
-	if (via_sii164_sense(i2c_bus)) {
+	if (via_sii164_sense(dev, i2c_bus)) {
 		ret = connector_status_connected;
 		DRM_DEBUG_KMS("DVI detected.\n");
 	}
@@ -496,7 +502,8 @@ via_sii164_drm_connector_helper_funcs = {
 	.get_modes = via_sii164_get_modes,
 };
 
-bool via_sii164_probe(struct i2c_adapter *i2c_bus)
+bool via_sii164_probe(struct drm_device *dev,
+			struct i2c_adapter *i2c_bus)
 {
 	u8 buf;
 	u16 vendor_id, device_id, revision;
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index ed5a8cd55203..be502e7aeb72 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -603,7 +603,7 @@ void via_ext_dvi_probe(struct drm_device *dev)
 			dev_priv->ext_tmds_i2c_bus = VIA_I2C_BUS2;
 			dev_priv->ext_tmds_transmitter = VIA_TMDS_VT1632;
 			dev_priv->mapped_i2c_bus |= VIA_I2C_BUS2;
-		} else if (via_sii164_probe(i2c_bus)) {
+		} else if (via_sii164_probe(dev, i2c_bus)) {
 			dev_priv->ext_tmds_presence = true;
 			dev_priv->ext_tmds_i2c_bus = VIA_I2C_BUS2;
 			dev_priv->ext_tmds_transmitter = VIA_TMDS_SII164;
@@ -619,7 +619,7 @@ void via_ext_dvi_probe(struct drm_device *dev)
 			dev_priv->ext_tmds_i2c_bus = VIA_I2C_BUS4;
 			dev_priv->ext_tmds_transmitter = VIA_TMDS_VT1632;
 			dev_priv->mapped_i2c_bus |= VIA_I2C_BUS4;
-		} else if (via_sii164_probe(i2c_bus)) {
+		} else if (via_sii164_probe(dev, i2c_bus)) {
 			dev_priv->ext_tmds_presence = true;
 			dev_priv->ext_tmds_i2c_bus = VIA_I2C_BUS4;
 			dev_priv->ext_tmds_transmitter = VIA_TMDS_SII164;
commit f8b19459bdf6cd0883fba640febebee97bd50f73
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:31:44 2023 -0700

    drm/via: Convert to drm_err() for via_pm.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_pm.c b/drivers/gpu/drm/via/via_pm.c
index e2d6d37fdf7c..12991312a883 100644
--- a/drivers/gpu/drm/via/via_pm.c
+++ b/drivers/gpu/drm/via/via_pm.c
@@ -84,7 +84,7 @@ int via_dev_pm_ops_suspend(struct device *dev)
 
 	ret = drm_mode_config_helper_suspend(drm_dev);
 	if (ret) {
-		DRM_ERROR("Failed to prepare for suspend.\n");
+		drm_err(drm_dev, "Failed to prepare for suspend.\n");
 		goto exit;
 	}
 
@@ -107,7 +107,7 @@ int via_dev_pm_ops_resume(struct device *dev)
 	drm_dbg_kms(drm_dev, "Entered %s.\n", __func__);
 
 	if (pci_enable_device(pdev)) {
-		DRM_ERROR("Failed to initialize a PCI "
+		drm_err(drm_dev, "Failed to initialize a PCI "
 				"after resume.\n");
 		ret = -EIO;
 		goto exit;
@@ -178,7 +178,7 @@ int via_dev_pm_ops_resume(struct device *dev)
 
 	ret = drm_mode_config_helper_resume(drm_dev);
 	if (ret) {
-		DRM_ERROR("Failed to perform a modeset "
+		drm_err(drm_dev, "Failed to perform a modeset "
 				"after resume.\n");
 		goto exit;
 	}
commit 38aa2c7b897e2bc01a2970da403238acd1df92e6
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:31:42 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_pm.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_pm.c b/drivers/gpu/drm/via/via_pm.c
index 43d27bc2b08a..e2d6d37fdf7c 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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(drm_dev, "Entered %s.\n", __func__);
 
 	if (pci_enable_device(pdev)) {
 		DRM_ERROR("Failed to initialize a PCI "
@@ -184,6 +184,6 @@ int via_dev_pm_ops_resume(struct device *dev)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(drm_dev, "Exiting %s.\n", __func__);
 	return ret;
 }
commit 6c9da149449a3762fb821ac475335f617088ab41
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:31:03 2023 -0700

    drm/via: Convert to drm_err() for via_object.c
    
    Discontinue the use of DRM_ERROR().
    
    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 eca3ded4ca2a..a967fad770e1 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -182,7 +182,7 @@ int via_bo_create(struct drm_device *dev,
 
 	bo = kzalloc(sizeof(*bo), GFP_KERNEL);
 	if (!bo) {
-		DRM_ERROR("Cannot allocate a TTM buffer object.\n");
+		drm_err(dev, "Cannot allocate a TTM buffer object.\n");
 		ret = -ENOMEM;
 		goto exit;
 	}
@@ -198,7 +198,7 @@ int via_bo_create(struct drm_device *dev,
 
 	ret = drm_gem_object_init(dev, &ttm_bo->base, size);
 	if (ret) {
-		DRM_ERROR("Cannot initialize a GEM object.\n");
+		drm_err(dev, "Cannot initialize a GEM object.\n");
 		goto error;
 	}
 
@@ -210,7 +210,7 @@ int via_bo_create(struct drm_device *dev,
 				PAGE_SIZE >> PAGE_SHIFT, false,
 				NULL, NULL, via_ttm_bo_destroy);
 	if (ret) {
-		DRM_ERROR("Cannot initialize a TTM object.\n");
+		drm_err(dev, "Cannot initialize a TTM object.\n");
 		goto exit;
 	}
 
@@ -291,7 +291,7 @@ int via_mm_init(struct drm_device *dev)
 				false,
 				true);
 	if (ret) {
-		DRM_ERROR("Failed initializing buffer object driver.\n");
+		drm_err(dev, "Failed initializing buffer object driver.\n");
 		goto exit;
 	}
 
@@ -302,7 +302,7 @@ int via_mm_init(struct drm_device *dev)
 				false,
 				dev_priv->vram_size >> PAGE_SHIFT);
 	if (ret) {
-		DRM_ERROR("Failed initializing TTM VRAM memory manager.\n");
+		drm_err(dev, "Failed initializing TTM VRAM memory manager.\n");
 		goto exit;
 	}
 
commit 10ed72c6c93aefe1be1c0d4dca3df870dd347fd3
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:31:02 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_object.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    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 0e6f1040eaac..eca3ded4ca2a 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -43,15 +43,15 @@
 
 static void via_gem_free(struct drm_gem_object *obj)
 {
-	struct ttm_buffer_object *ttm_bo;
-
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	struct ttm_buffer_object *ttm_bo = container_of(obj,
+				struct ttm_buffer_object, base);
+	struct drm_device *dev = ttm_bo->base.dev;
 
-	ttm_bo = container_of(obj, struct ttm_buffer_object, base);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	ttm_bo_put(ttm_bo);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static const struct vm_operations_struct via_ttm_bo_vm_ops = {
@@ -72,9 +72,11 @@ static const struct drm_gem_object_funcs via_gem_object_funcs = {
 void via_ttm_domain_to_placement(struct via_bo *bo,
 					uint32_t ttm_domain)
 {
+	struct ttm_buffer_object *ttm_bo = &bo->ttm_bo;
+	struct drm_device *dev = ttm_bo->base.dev;
 	unsigned i = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	bo->placement.placement = bo->placements;
 	bo->placement.busy_placement = bo->placements;
@@ -106,32 +108,32 @@ void via_ttm_domain_to_placement(struct via_bo *bo,
 	bo->placement.num_placement = i;
 	bo->placement.num_busy_placement = i;
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_ttm_bo_destroy(struct ttm_buffer_object *tbo)
 {
 	struct via_bo *bo;
+	struct drm_device *dev = tbo->base.dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	bo = to_ttm_bo(tbo);
 
 	drm_gem_object_release(&tbo->base);
 	kfree(bo);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 int via_bo_pin(struct via_bo *bo, uint32_t ttm_domain)
 {
-	struct ttm_buffer_object *ttm_bo;
+	struct ttm_buffer_object *ttm_bo = &bo->ttm_bo;
+	struct drm_device *dev = ttm_bo->base.dev;
 	struct ttm_operation_ctx ctx = {false, false};
 	int ret = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	ttm_bo = &bo->ttm_bo;
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (ttm_bo->pin_count) {
 		goto pin;
@@ -147,21 +149,20 @@ pin:
 	ttm_bo_pin(ttm_bo);
 exit:
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 void via_bo_unpin(struct via_bo *bo)
 {
-	struct ttm_buffer_object *ttm_bo;
+	struct ttm_buffer_object *ttm_bo = &bo->ttm_bo;
+	struct drm_device *dev = ttm_bo->base.dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	ttm_bo = &bo->ttm_bo;
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	ttm_bo_unpin(ttm_bo);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 int via_bo_create(struct drm_device *dev,
@@ -177,7 +178,7 @@ int via_bo_create(struct drm_device *dev,
 	struct via_bo *bo;
 	int ret;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	bo = kzalloc(sizeof(*bo), GFP_KERNEL);
 	if (!bo) {
@@ -240,18 +241,17 @@ int via_bo_create(struct drm_device *dev,
 error:
 	kfree(bo);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 void via_bo_destroy(struct via_bo *bo, bool kmap)
 {
-	struct ttm_buffer_object *ttm_bo;
+	struct ttm_buffer_object *ttm_bo = &bo->ttm_bo;
+	struct drm_device *dev = ttm_bo->base.dev;
 	int ret;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	ttm_bo = &bo->ttm_bo;
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	ttm_range_man_fini(&dev_priv->bdev, TTM_PL_VRAM);
 
 	ttm_device_fini(&dev_priv->bdev);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit 86f493d33729bc14dd2d655bc9366d5832ef6065
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:31:01 2023 -0700

    drm/via: Use drm_device for function argument inside via_object.c
    
    Obtain a pointer to via_drm_priv via drm_device.
    
    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 eec45ec05e64..5ca883a30df6 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -321,8 +321,8 @@ int via_bo_create(struct drm_device *dev, struct ttm_device *bdev,
 			uint32_t ttm_domain, bool kmap,
 			struct via_bo **bo_ptr);
 void via_bo_destroy(struct via_bo *bo, bool kmap);
-int via_mm_init(struct via_drm_priv *dev_priv);
-void via_mm_fini(struct via_drm_priv *dev_priv);
+int via_mm_init(struct drm_device *dev);
+void via_mm_fini(struct drm_device *dev);
 
 void via_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
 					uint32_t di_port, bool io_pad_on);
diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 79e24525e717..d3bb9b94d096 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1315,7 +1315,6 @@ void via_modeset_fini(struct drm_device *dev)
 
 int via_drm_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__);
@@ -1326,7 +1325,7 @@ int via_drm_init(struct drm_device *dev)
 		goto exit;
 	}
 
-	ret = via_mm_init(dev_priv);
+	ret = via_mm_init(dev);
 	if (ret) {
 		drm_err(dev, "Failed to initialize TTM.\n");
 		goto exit;
@@ -1343,7 +1342,7 @@ int via_drm_init(struct drm_device *dev)
 	goto exit;
 error_modeset:
 	via_modeset_fini(dev);
-	via_mm_fini(dev_priv);
+	via_mm_fini(dev);
 	via_device_fini(dev);
 exit:
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
@@ -1352,12 +1351,10 @@ exit:
 
 void via_drm_fini(struct drm_device *dev)
 {
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_modeset_fini(dev);
-	via_mm_fini(dev_priv);
+	via_mm_fini(dev);
 	via_device_fini(dev);
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
diff --git a/drivers/gpu/drm/via/via_object.c b/drivers/gpu/drm/via/via_object.c
index ea350da5968a..0e6f1040eaac 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -273,9 +273,9 @@ exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-int via_mm_init(struct via_drm_priv *dev_priv)
+int via_mm_init(struct drm_device *dev)
 {
-	struct drm_device *dev = &dev_priv->dev;
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	int ret;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -311,8 +311,10 @@ exit:
 	return ret;
 }
 
-void via_mm_fini(struct via_drm_priv *dev_priv)
+void via_mm_fini(struct drm_device *dev)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	ttm_range_man_fini(&dev_priv->bdev, TTM_PL_VRAM);
commit 0bd4b3f62bff6080ba444a6d10a222248d574b08
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:28:04 2023 -0700

    drm/via: Convert to drm_err() for via_lvds.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index b4208d57efae..4be95e063ca0 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -1184,7 +1184,7 @@ void via_lvds_init(struct drm_device *dev)
 
 	enc = kzalloc(sizeof(*enc) + sizeof(*con), GFP_KERNEL);
 	if (!enc) {
-		DRM_ERROR("Failed to allocate FP.\n");
+		drm_err(dev, "Failed to allocate FP.\n");
 		goto exit;
 	}
 
commit 2df0e721ee1438834da5a693d95fb320b9ca1830
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:28:02 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_lvds.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index e0286ae143ce..b4208d57efae 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -147,7 +147,7 @@ static bool via_fp_probe_edid(struct drm_device *dev,
 	int i2c_ret;
 	bool ret = false;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	i2c_ret = i2c_transfer(i2c_bus, msgs, 2);
 	if (i2c_ret != 2) {
@@ -160,7 +160,7 @@ static bool via_fp_probe_edid(struct drm_device *dev,
 
 	ret = true;
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -169,7 +169,7 @@ static void via_lvds_cle266_soft_power_seq(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (power_state) {
 		/* Wait for 25 ms. */
@@ -215,7 +215,7 @@ static void via_lvds_cle266_soft_power_seq(struct drm_device *dev,
 		via_lvds_set_primary_soft_vdd(VGABASE, false);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_primary_soft_power_seq(struct drm_device *dev,
@@ -223,7 +223,7 @@ static void via_lvds_primary_soft_power_seq(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/* Turn off FP hardware power sequence. */
 	via_lvds_set_primary_hard_power(VGABASE, false);
@@ -284,7 +284,7 @@ static void via_lvds_primary_soft_power_seq(struct drm_device *dev,
 		via_lvds_set_primary_direct_display_period(VGABASE, false);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_secondary_soft_power_seq(struct drm_device *dev,
@@ -292,7 +292,7 @@ static void via_lvds_secondary_soft_power_seq(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/* Turn off FP hardware power sequence. */
 	via_lvds_set_secondary_hard_power(VGABASE, false);
@@ -353,7 +353,7 @@ static void via_lvds_secondary_soft_power_seq(struct drm_device *dev,
 		via_lvds_set_secondary_direct_display_period(VGABASE, false);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_primary_hard_power_seq(struct drm_device *dev,
@@ -361,7 +361,7 @@ static void via_lvds_primary_hard_power_seq(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/* Use hardware FP power sequence control. */
 	via_lvds_set_primary_power_seq_type(VGABASE, true);
@@ -386,7 +386,7 @@ static void via_lvds_primary_hard_power_seq(struct drm_device *dev,
 		via_lvds_set_primary_direct_display_period(VGABASE, false);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_power(struct drm_device *dev,
@@ -395,7 +395,7 @@ static void via_lvds_power(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_CLE266_GFX:
@@ -429,13 +429,13 @@ static void via_lvds_power(struct drm_device *dev,
 		via_lvds1_set_power(VGABASE, power_state);
 		break;
 	default:
-		DRM_DEBUG_KMS("VIA Technologies Chrome IGP "
+		drm_dbg_kms(dev, "VIA Technologies Chrome IGP "
 				"FP Power: Unrecognized "
 				"PCI Device ID.\n");
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -446,7 +446,7 @@ static void via_lvds_io_pad_setting(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_DVP0:
@@ -481,9 +481,9 @@ static void via_lvds_io_pad_setting(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("FP I/O Pad: %s\n", io_pad_on ? "On": "Off");
+	drm_dbg_kms(dev, "FP I/O Pad: %s\n", io_pad_on ? "On": "Off");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_format(struct drm_device *dev,
@@ -492,7 +492,7 @@ static void via_lvds_format(struct drm_device *dev,
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 temp = format & 0x01;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_LVDS1:
@@ -510,7 +510,7 @@ static void via_lvds_format(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_output_format(struct drm_device *dev,
@@ -519,7 +519,7 @@ static void via_lvds_output_format(struct drm_device *dev,
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 temp = output_format & 0x01;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_LVDS1:
@@ -537,7 +537,7 @@ static void via_lvds_output_format(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_dithering(struct drm_device *dev,
@@ -545,7 +545,7 @@ static void via_lvds_dithering(struct drm_device *dev,
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_LVDS1:
@@ -563,7 +563,7 @@ static void via_lvds_dithering(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -575,7 +575,7 @@ static void via_lvds_display_source(struct drm_device *dev,
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 display_source = index & 0x01;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch(di_port) {
 	case VIA_DI_PORT_DVP0:
@@ -612,10 +612,10 @@ static void via_lvds_display_source(struct drm_device *dev,
 		break;
 	}
 
-	DRM_DEBUG_KMS("FP Display Source: IGA%d\n",
+	drm_dbg_kms(dev, "FP Display Source: IGA%d\n",
 			display_source + 1);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_dpms(struct drm_encoder *encoder, int mode)
@@ -624,7 +624,7 @@ static void via_lvds_dpms(struct drm_encoder *encoder, int mode)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
@@ -641,7 +641,7 @@ static void via_lvds_dpms(struct drm_encoder *encoder, int mode)
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_prepare(struct drm_encoder *encoder)
@@ -650,12 +650,12 @@ static void via_lvds_prepare(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_lvds_power(dev, enc->di_port, false);
 	via_lvds_io_pad_setting(dev, enc->di_port, false);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_commit(struct drm_encoder *encoder)
@@ -664,12 +664,12 @@ static void via_lvds_commit(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_lvds_power(dev, enc->di_port, true);
 	via_lvds_io_pad_setting(dev, enc->di_port, true);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void
@@ -682,7 +682,7 @@ via_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/* Temporary implementation.*/
 	switch (pdev->device) {
@@ -713,7 +713,7 @@ via_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 
 	via_lvds_display_source(dev, enc->di_port, iga->index);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_lvds_disable(struct drm_encoder *encoder)
@@ -722,12 +722,12 @@ static void via_lvds_disable(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_lvds_power(dev, enc->di_port, false);
 	via_lvds_io_pad_setting(dev, enc->di_port, false);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 const struct drm_encoder_helper_funcs via_lvds_helper_funcs = {
@@ -757,7 +757,7 @@ via_lvds_detect(struct drm_connector *connector, bool force)
 	u8 mask;
 	uint32_t i, i2c_bus_bit;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (machine_is_olpc()) {
 		ret = connector_status_connected;
@@ -792,8 +792,8 @@ via_lvds_detect(struct drm_connector *connector, bool force)
 			if (edid->input & DRM_EDID_INPUT_DIGITAL) {
 				ret = connector_status_connected;
 				kfree(edid);
-				DRM_DEBUG_KMS("FP detected.\n");
-				DRM_DEBUG_KMS("i2c_bus_bit: %x\n", i2c_bus_bit);
+				drm_dbg_kms(dev, "FP detected.\n");
+				drm_dbg_kms(dev, "i2c_bus_bit: %x\n", i2c_bus_bit);
 				goto exit;
 			} else {
 				kfree(edid);
@@ -814,7 +814,7 @@ via_lvds_detect(struct drm_connector *connector, bool force)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -844,7 +844,7 @@ via_lvds_get_modes(struct drm_connector *connector)
 	int count = 0;
 	uint32_t i, i2c_bus_bit;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/* OLPC is very special */
 	if (machine_is_olpc()) {
@@ -894,8 +894,8 @@ via_lvds_get_modes(struct drm_connector *connector)
 				drm_connector_update_edid_property(connector, edid);
 				count = drm_add_edid_modes(connector, edid);
 				kfree(edid);
-				DRM_DEBUG_KMS("FP EDID information was obtained.\n");
-				DRM_DEBUG_KMS("i2c_bus_bit: %x\n", i2c_bus_bit);
+				drm_dbg_kms(dev, "FP EDID information was obtained.\n");
+				drm_dbg_kms(dev, "i2c_bus_bit: %x\n", i2c_bus_bit);
 				break;
 			} else {
 				kfree(edid);
@@ -924,7 +924,7 @@ via_lvds_get_modes(struct drm_connector *connector)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return count;
 }
 
@@ -945,15 +945,15 @@ void via_lvds_probe(struct drm_device *dev)
 	u8 sr12, sr13, sr5a;
 	u8 cr3b;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	sr12 = vga_rseq(VGABASE, 0x12);
 	sr13 = vga_rseq(VGABASE, 0x13);
 	cr3b = vga_rcrt(VGABASE, 0x3b);
 
-	DRM_DEBUG_KMS("sr12: 0x%02x\n", sr12);
-	DRM_DEBUG_KMS("sr13: 0x%02x\n", sr13);
-	DRM_DEBUG_KMS("cr3b: 0x%02x\n", cr3b);
+	drm_dbg_kms(dev, "sr12: 0x%02x\n", sr12);
+	drm_dbg_kms(dev, "sr13: 0x%02x\n", sr13);
+	drm_dbg_kms(dev, "cr3b: 0x%02x\n", cr3b);
 
 	/* Detect the presence of FPs. */
 	switch (pdev->device) {
@@ -1027,7 +1027,7 @@ void via_lvds_probe(struct drm_device *dev)
 		/* Save SR5A. */
 		sr5a = vga_rseq(VGABASE, 0x5a);
 
-		DRM_DEBUG_KMS("sr5a: 0x%02x\n", sr5a);
+		drm_dbg_kms(dev, "sr5a: 0x%02x\n", sr5a);
 
 		/* Set SR5A[0] to 1.
 		 * This allows the read out of the alternative
@@ -1151,22 +1151,22 @@ void via_lvds_probe(struct drm_device *dev)
 	drm_connector_unregister(&connector);
 	drm_connector_cleanup(&connector);
 
-	DRM_DEBUG_KMS("int_fp1_presence: %x\n",
+	drm_dbg_kms(dev, "int_fp1_presence: %x\n",
 			dev_priv->int_fp1_presence);
-	DRM_DEBUG_KMS("int_fp1_di_port: 0x%08x\n",
+	drm_dbg_kms(dev, "int_fp1_di_port: 0x%08x\n",
 			dev_priv->int_fp1_di_port);
-	DRM_DEBUG_KMS("int_fp1_i2c_bus: 0x%08x\n",
+	drm_dbg_kms(dev, "int_fp1_i2c_bus: 0x%08x\n",
 			dev_priv->int_fp1_i2c_bus);
-	DRM_DEBUG_KMS("int_fp2_presence: %x\n",
+	drm_dbg_kms(dev, "int_fp2_presence: %x\n",
 			dev_priv->int_fp2_presence);
-	DRM_DEBUG_KMS("int_fp2_di_port: 0x%08x\n",
+	drm_dbg_kms(dev, "int_fp2_di_port: 0x%08x\n",
 			dev_priv->int_fp2_di_port);
-	DRM_DEBUG_KMS("int_fp2_i2c_bus: 0x%08x\n",
+	drm_dbg_kms(dev, "int_fp2_i2c_bus: 0x%08x\n",
 			dev_priv->int_fp2_i2c_bus);
-	DRM_DEBUG_KMS("mapped_i2c_bus: 0x%08x\n",
+	drm_dbg_kms(dev, "mapped_i2c_bus: 0x%08x\n",
 			dev_priv->mapped_i2c_bus);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_lvds_init(struct drm_device *dev)
@@ -1175,7 +1175,7 @@ void via_lvds_init(struct drm_device *dev)
 	struct via_connector *con;
 	struct via_encoder *enc;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if ((!(dev_priv->int_fp1_presence)) &&
 		(!(dev_priv->int_fp2_presence))) {
@@ -1228,6 +1228,6 @@ void via_lvds_init(struct drm_device *dev)
 	/* Init TD timing register (power sequence) */
 	via_init_td_timing_regs(dev);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return;
 }
commit 92399dd380b03fa382d5ea24412b12a1d39991cc
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:28:00 2023 -0700

    drm/via: Add drm_device input parameter to via_fp_probe_edid()
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index 70b6989c56ce..e0286ae143ce 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -125,7 +125,8 @@ static void via_init_td_timing_regs(struct drm_device *dev)
 	}
 }
 
-static bool via_fp_probe_edid(struct i2c_adapter *i2c_bus)
+static bool via_fp_probe_edid(struct drm_device *dev,
+				struct i2c_adapter *i2c_bus)
 {
 	u8 out = 0x0;
 	u8 buf[8];
@@ -781,7 +782,7 @@ via_lvds_detect(struct drm_connector *connector, bool force)
 			continue;
 		}
 
-		if (!via_fp_probe_edid(i2c_bus)) {
+		if (!via_fp_probe_edid(dev, i2c_bus)) {
 			i2c_bus_bit = i2c_bus_bit << 1;
 			continue;
 		}
commit 36eaec35753e2b2f8e64c5d55bf2ed6a364ed4ea
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:27:58 2023 -0700

    drm/via: Remove PCI device ID input parameter from via_lvds_power()
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index dd8748886344..70b6989c56ce 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -389,14 +389,14 @@ static void via_lvds_primary_hard_power_seq(struct drm_device *dev,
 }
 
 static void via_lvds_power(struct drm_device *dev,
-				unsigned short device,
 				u32 di_port, bool power_state)
 {
+	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	switch (device) {
+	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_CLE266_GFX:
 		via_lvds_cle266_soft_power_seq(dev, power_state);
 		break;
@@ -622,21 +622,18 @@ static void via_lvds_dpms(struct drm_encoder *encoder, int mode)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct pci_dev *pdev = to_pci_dev(dev->dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
-		via_lvds_power(dev, pdev->device, enc->di_port,
-				true);
+		via_lvds_power(dev, enc->di_port, true);
 		via_lvds_io_pad_setting(dev, enc->di_port, true);
 		break;
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_OFF:
-		via_lvds_power(dev, pdev->device, enc->di_port,
-				false);
+		via_lvds_power(dev, enc->di_port, false);
 		via_lvds_io_pad_setting(dev, enc->di_port, false);
 		break;
 	default:
@@ -651,11 +648,10 @@ static void via_lvds_prepare(struct drm_encoder *encoder)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct pci_dev *pdev = to_pci_dev(dev->dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_lvds_power(dev, pdev->device, enc->di_port, false);
+	via_lvds_power(dev, enc->di_port, false);
 	via_lvds_io_pad_setting(dev, enc->di_port, false);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -666,11 +662,10 @@ static void via_lvds_commit(struct drm_encoder *encoder)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct pci_dev *pdev = to_pci_dev(dev->dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_lvds_power(dev, pdev->device, enc->di_port, true);
+	via_lvds_power(dev, enc->di_port, true);
 	via_lvds_io_pad_setting(dev, enc->di_port, true);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -725,11 +720,10 @@ static void via_lvds_disable(struct drm_encoder *encoder)
 	struct via_encoder *enc = container_of(encoder,
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
-	struct pci_dev *pdev = to_pci_dev(dev->dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_lvds_power(dev, pdev->device, enc->di_port, false);
+	via_lvds_power(dev, enc->di_port, false);
 	via_lvds_io_pad_setting(dev, enc->di_port, false);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
commit 6ef028567fdd419f4ade8626ab0bc1e40b140474
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 09:27:57 2023 -0700

    drm/via: Use drm_device for function argument inside via_lvds.c
    
    Obtain a pointer to via_drm_priv via drm_device.
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index 1460be6e079a..dd8748886344 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -163,9 +163,11 @@ exit:
 	return ret;
 }
 
-static void via_lvds_cle266_soft_power_seq(struct via_drm_priv *dev_priv,
+static void via_lvds_cle266_soft_power_seq(struct drm_device *dev,
 						bool power_state)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	if (power_state) {
@@ -215,9 +217,11 @@ static void via_lvds_cle266_soft_power_seq(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_lvds_primary_soft_power_seq(struct via_drm_priv *dev_priv,
+static void via_lvds_primary_soft_power_seq(struct drm_device *dev,
 						bool power_state)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	/* Turn off FP hardware power sequence. */
@@ -282,9 +286,11 @@ static void via_lvds_primary_soft_power_seq(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_lvds_secondary_soft_power_seq(struct via_drm_priv *dev_priv,
+static void via_lvds_secondary_soft_power_seq(struct drm_device *dev,
 						bool power_state)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	/* Turn off FP hardware power sequence. */
@@ -349,9 +355,11 @@ static void via_lvds_secondary_soft_power_seq(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_lvds_primary_hard_power_seq(struct via_drm_priv *dev_priv,
+static void via_lvds_primary_hard_power_seq(struct drm_device *dev,
 						bool power_state)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	/* Use hardware FP power sequence control. */
@@ -380,15 +388,17 @@ static void via_lvds_primary_hard_power_seq(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_lvds_power(struct via_drm_priv *dev_priv,
+static void via_lvds_power(struct drm_device *dev,
 				unsigned short device,
 				u32 di_port, bool power_state)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch (device) {
 	case PCI_DEVICE_ID_VIA_CLE266_GFX:
-		via_lvds_cle266_soft_power_seq(dev_priv, power_state);
+		via_lvds_cle266_soft_power_seq(dev, power_state);
 		break;
 	case PCI_DEVICE_ID_VIA_KM400_GFX:
 	case PCI_DEVICE_ID_VIA_P4M800_PRO_GFX:
@@ -397,24 +407,24 @@ static void via_lvds_power(struct via_drm_priv *dev_priv,
 	case PCI_DEVICE_ID_VIA_P4M890_GFX:
 	case PCI_DEVICE_ID_VIA_CHROME9:
 	case PCI_DEVICE_ID_VIA_CHROME9_HC:
-		via_lvds_primary_hard_power_seq(dev_priv, power_state);
+		via_lvds_primary_hard_power_seq(dev, power_state);
 		break;
 	case PCI_DEVICE_ID_VIA_UNICHROME_PRO_II:
 	case PCI_DEVICE_ID_VIA_CHROME9_HC3:
 		if (di_port & VIA_DI_PORT_LVDS1) {
-			via_lvds_primary_soft_power_seq(dev_priv, power_state);
+			via_lvds_primary_soft_power_seq(dev, power_state);
 			via_lvds1_set_power(VGABASE, power_state);
 		}
 
 		if (di_port & VIA_DI_PORT_LVDS2) {
-			via_lvds_secondary_soft_power_seq(dev_priv, power_state);
+			via_lvds_secondary_soft_power_seq(dev, power_state);
 			via_lvds2_set_power(VGABASE, power_state);
 		}
 
 		break;
 	case PCI_DEVICE_ID_VIA_CHROME9_HCM:
 	case PCI_DEVICE_ID_VIA_CHROME9_HD:
-		via_lvds_primary_hard_power_seq(dev_priv, power_state);
+		via_lvds_primary_hard_power_seq(dev, power_state);
 		via_lvds1_set_power(VGABASE, power_state);
 		break;
 	default:
@@ -430,9 +440,11 @@ static void via_lvds_power(struct via_drm_priv *dev_priv,
 /*
  * Sets flat panel I/O pad state.
  */
-static void via_lvds_io_pad_setting(struct via_drm_priv *dev_priv,
+static void via_lvds_io_pad_setting(struct drm_device *dev,
 					u32 di_port, bool io_pad_on)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch(di_port) {
@@ -473,9 +485,10 @@ static void via_lvds_io_pad_setting(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_lvds_format(struct via_drm_priv *dev_priv,
+static void via_lvds_format(struct drm_device *dev,
 				u32 di_port, u8 format)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 temp = format & 0x01;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -499,9 +512,10 @@ static void via_lvds_format(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_lvds_output_format(struct via_drm_priv *dev_priv,
+static void via_lvds_output_format(struct drm_device *dev,
 					u32 di_port, u8 output_format)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 temp = output_format & 0x01;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -525,9 +539,11 @@ static void via_lvds_output_format(struct via_drm_priv *dev_priv,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_lvds_dithering(struct via_drm_priv *dev_priv,
+static void via_lvds_dithering(struct drm_device *dev,
 				u32 di_port, bool dithering)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch(di_port) {
@@ -552,9 +568,10 @@ static void via_lvds_dithering(struct via_drm_priv *dev_priv,
 /*
  * Sets flat panel display source.
  */
-static void via_lvds_display_source(struct via_drm_priv *dev_priv,
+static void via_lvds_display_source(struct drm_device *dev,
 					u32 di_port, int index)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 display_source = index & 0x01;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -606,22 +623,21 @@ static void via_lvds_dpms(struct drm_encoder *encoder, int mode)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
-		via_lvds_power(dev_priv, pdev->device, enc->di_port,
+		via_lvds_power(dev, pdev->device, enc->di_port,
 				true);
-		via_lvds_io_pad_setting(dev_priv, enc->di_port, true);
+		via_lvds_io_pad_setting(dev, enc->di_port, true);
 		break;
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_OFF:
-		via_lvds_power(dev_priv, pdev->device, enc->di_port,
+		via_lvds_power(dev, pdev->device, enc->di_port,
 				false);
-		via_lvds_io_pad_setting(dev_priv, enc->di_port, false);
+		via_lvds_io_pad_setting(dev, enc->di_port, false);
 		break;
 	default:
 		break;
@@ -636,12 +652,11 @@ static void via_lvds_prepare(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_lvds_power(dev_priv, pdev->device, enc->di_port, false);
-	via_lvds_io_pad_setting(dev_priv, enc->di_port, false);
+	via_lvds_power(dev, pdev->device, enc->di_port, false);
+	via_lvds_io_pad_setting(dev, enc->di_port, false);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
@@ -652,12 +667,11 @@ static void via_lvds_commit(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_lvds_power(dev_priv, pdev->device, enc->di_port, true);
-	via_lvds_io_pad_setting(dev_priv, enc->di_port, true);
+	via_lvds_power(dev, pdev->device, enc->di_port, true);
+	via_lvds_io_pad_setting(dev, enc->di_port, true);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
@@ -689,19 +703,19 @@ via_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 	case PCI_DEVICE_ID_VIA_CHROME9_HCM:
 	case PCI_DEVICE_ID_VIA_CHROME9_HD:
 		/* OPENLDI Mode */
-		via_lvds_format(dev_priv, enc->di_port, 0x01);
+		via_lvds_format(dev, enc->di_port, 0x01);
 
 		/* Sequential Mode */
-		via_lvds_output_format(dev_priv, enc->di_port, 0x01);
+		via_lvds_output_format(dev, enc->di_port, 0x01);
 
 		/* Turn on dithering. */
-		via_lvds_dithering(dev_priv, enc->di_port, true);
+		via_lvds_dithering(dev, enc->di_port, true);
 		break;
 	default:
 		break;
 	}
 
-	via_lvds_display_source(dev_priv, enc->di_port, iga->index);
+	via_lvds_display_source(dev, enc->di_port, iga->index);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
@@ -712,12 +726,11 @@ static void via_lvds_disable(struct drm_encoder *encoder)
 					struct via_encoder, base);
 	struct drm_device *dev = encoder->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
-	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_lvds_power(dev_priv, pdev->device, enc->di_port, false);
-	via_lvds_io_pad_setting(dev_priv, enc->di_port, false);
+	via_lvds_power(dev, pdev->device, enc->di_port, false);
+	via_lvds_io_pad_setting(dev, enc->di_port, false);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
commit d443b6544d40ed3fdea05a541151604d6c972a9f
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:50:20 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_ioctl.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_ioctl.c b/drivers/gpu/drm/via/via_ioctl.c
index 7fac7a8a15c3..b5e4934162e4 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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
commit 72267b4d587824940b1a32467f34f005c5cb0507
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:48:46 2023 -0700

    drm/via: No need to initialize VRAM MTRR status holding variable
    
    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 584bc73b4b4c..79e24525e717 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1320,8 +1320,6 @@ int via_drm_init(struct drm_device *dev)
 
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
-	dev_priv->vram_mtrr = -ENXIO;
-
 	ret = via_device_init(dev);
 	if (ret) {
 		drm_err(dev, "Failed to initialize Chrome IGP.\n");
commit 913f87890f82ea3f39394bb0e073965e755e63bb
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:48:44 2023 -0700

    drm/via: Convert to drm_dbg_driver() for via_init.c
    
    Discontinue the use of DRM_INFO().
    
    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 00c18a752048..584bc73b4b4c 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -955,7 +955,7 @@ int via_vram_detect(struct drm_device *dev)
 		break;
 	}
 
-	DRM_INFO("Found %s video RAM.\n", name);
+	drm_dbg_driver(dev, "Found %s video RAM.\n", name);
 out_err:
 	if (bridge)
 		pci_dev_put(bridge);
commit 8e847138ff55b19f0aa3909efbb0ee0e1f5462e8
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:48:43 2023 -0700

    drm/via: Convert to drm_err() for via_init.c
    
    Discontinue the use of DRM_ERROR().
    
    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 9c21dbf3b4b2..00c18a752048 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -763,14 +763,14 @@ int via_vram_detect(struct drm_device *dev)
 
 	if (!bridge) {
 		ret = -EINVAL;
-		DRM_ERROR("No host bridge found...\n");
+		drm_err(dev, "No host bridge found...\n");
 		goto out_err;
 	}
 
 	if (!fn3 && pdev->device != PCI_DEVICE_ID_VIA_CLE266_GFX
 		&& pdev->device != PCI_DEVICE_ID_VIA_KM400_GFX) {
 		ret = -EINVAL;
-		DRM_ERROR("No function 3 on host bridge...\n");
+		drm_err(dev, "No function 3 on host bridge...\n");
 		goto out_err;
 	}
 
@@ -891,7 +891,7 @@ int via_vram_detect(struct drm_device *dev)
 		break;
 
 	default:
-		DRM_ERROR("Unknown north bridge device: 0x%04x\n",
+		drm_err(dev, "Unknown north bridge device: 0x%04x\n",
 				bridge->device);
 		goto out_err;
 	}
@@ -1183,7 +1183,7 @@ static int via_device_init(struct drm_device *dev)
 
 	ret = via_vram_detect(dev);
 	if (ret) {
-		DRM_ERROR("Failed to detect video RAM.\n");
+		drm_err(dev, "Failed to detect video RAM.\n");
 		goto exit;
 	}
 
@@ -1192,13 +1192,13 @@ static int via_device_init(struct drm_device *dev)
 	 */
 	ret = via_vram_init(dev);
 	if (ret) {
-		DRM_ERROR("Failed to initialize video RAM.\n");
+		drm_err(dev, "Failed to initialize video RAM.\n");
 		goto exit;
 	}
 
 	ret = via_mmio_init(dev);
 	if (ret) {
-		DRM_ERROR("Failed to initialize MMIO.\n");
+		drm_err(dev, "Failed to initialize MMIO.\n");
 		goto exit;
 	}
 
@@ -1261,7 +1261,7 @@ int via_modeset_init(struct drm_device *dev)
 	via_i2c_reg_init(dev_priv);
 	ret = via_i2c_init(dev);
 	if (ret) {
-		DRM_ERROR("Failed to initialize I2C bus!\n");
+		drm_err(dev, "Failed to initialize I2C bus!\n");
 		goto exit;
 	}
 
@@ -1324,13 +1324,13 @@ int via_drm_init(struct drm_device *dev)
 
 	ret = via_device_init(dev);
 	if (ret) {
-		DRM_ERROR("Failed to initialize Chrome IGP.\n");
+		drm_err(dev, "Failed to initialize Chrome IGP.\n");
 		goto exit;
 	}
 
 	ret = via_mm_init(dev_priv);
 	if (ret) {
-		DRM_ERROR("Failed to initialize TTM.\n");
+		drm_err(dev, "Failed to initialize TTM.\n");
 		goto exit;
 	}
 
@@ -1338,7 +1338,7 @@ int via_drm_init(struct drm_device *dev)
 
 	ret = via_modeset_init(dev);
 	if (ret) {
-		DRM_ERROR("Failed to initialize mode setting.\n");
+		drm_err(dev, "Failed to initialize mode setting.\n");
 		goto error_modeset;
 	}
 
commit e50407c74abf96261392a74f4d33704ba0780430
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:48:42 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_init.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    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 f606adfd86da..9c21dbf3b4b2 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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (dev_priv->mmio) {
 		iounmap(dev_priv->mmio);
 		dev_priv->mmio = NULL;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static int via_device_init(struct drm_device *dev)
 {
 	int ret;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 static void via_device_fini(struct drm_device *dev)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_mmio_fini(dev);
 	via_vram_fini(dev);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 int via_modeset_init(struct drm_device *dev)
@@ -1318,7 +1318,7 @@ int via_drm_init(struct drm_device *dev)
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	int ret = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	dev_priv->vram_mtrr = -ENXIO;
 
@@ -1348,7 +1348,7 @@ error_modeset:
 	via_mm_fini(dev_priv);
 	via_device_fini(dev);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -1356,11 +1356,11 @@ void via_drm_fini(struct drm_device *dev)
 {
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_modeset_fini(dev);
 	via_mm_fini(dev_priv);
 	via_device_fini(dev);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit c69950e653e2ad3e9a04daf1dae29eb2481f444f
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:48:40 2023 -0700

    drm/via: Use drm_device for function argument inside via_init.c
    
    Obtain a pointer to via_drm_priv via drm_device.
    
    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 296672421122..eec45ec05e64 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -306,17 +306,6 @@ extern int via_driver_num_ioctls;
 
 extern struct ttm_device_funcs via_bo_driver;
 
-int via_vram_detect(struct via_drm_priv *dev_priv);
-int via_vram_init(struct via_drm_priv *dev_priv);
-void via_vram_fini(struct via_drm_priv *dev_priv);
-int via_mmio_init(struct via_drm_priv *dev_priv);
-void via_mmio_fini(struct via_drm_priv *dev_priv);
-void via_graphics_unlock(struct via_drm_priv *dev_priv);
-int via_device_init(struct via_drm_priv *dev_priv);
-void via_device_fini(struct via_drm_priv *dev_priv);
-void via_mode_config_init(struct via_drm_priv *dev_priv);
-int via_modeset_init(struct drm_device *dev);
-void via_modeset_fini(struct drm_device *dev);
 int via_drm_init(struct drm_device *dev);
 void via_drm_fini(struct drm_device *dev);
 
diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 07e2addfb36f..f606adfd86da 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -41,9 +41,10 @@
 #include "via_drv.h"
 
 
-static int cle266_mem_type(struct via_drm_priv *dev_priv,
+static int cle266_mem_type(struct drm_device *dev,
 				struct pci_dev *bridge)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 type, fsb, freq;
 	int ret;
 
@@ -142,9 +143,10 @@ static int cle266_mem_type(struct via_drm_priv *dev_priv,
 	return ret;
 }
 
-static int km400_mem_type(struct via_drm_priv *dev_priv,
+static int km400_mem_type(struct drm_device *dev,
 				struct pci_dev *bridge)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 fsb, freq, rev;
 	int ret;
 
@@ -302,10 +304,11 @@ static int km400_mem_type(struct via_drm_priv *dev_priv,
 	return ret;
 }
 
-static int p4m800_mem_type(struct via_drm_priv *dev_priv,
+static int p4m800_mem_type(struct drm_device *dev,
 				struct pci_bus *bus,
 				struct pci_dev *fn3)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct pci_dev *fn4 = pci_get_slot(bus, PCI_DEVFN(0, 4));
 	int ret, freq = 0;
 	u8 type, fsb;
@@ -370,8 +373,9 @@ static int p4m800_mem_type(struct via_drm_priv *dev_priv,
 	return ret;
 }
 
-static int km8xx_mem_type(struct via_drm_priv *dev_priv)
+static int km8xx_mem_type(struct drm_device *dev)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct pci_dev *dram, *misc = NULL;
 	int ret = -ENXIO;
 	u8 type, tmp;
@@ -503,10 +507,11 @@ static int km8xx_mem_type(struct via_drm_priv *dev_priv)
 	return ret;
 }
 
-static int cn400_mem_type(struct via_drm_priv *dev_priv,
+static int cn400_mem_type(struct drm_device *dev,
 				struct pci_bus *bus,
 				struct pci_dev *fn3)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct pci_dev *fn2 = pci_get_slot(bus, PCI_DEVFN(0, 2));
 	int ret, freq = 0;
 	u8 type, fsb;
@@ -567,9 +572,10 @@ static int cn400_mem_type(struct via_drm_priv *dev_priv,
 	return ret;
 }
 
-static int cn700_mem_type(struct via_drm_priv *dev_priv,
+static int cn700_mem_type(struct drm_device *dev,
 				struct pci_dev *fn3)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	int ret;
 	u8 tmp;
 
@@ -601,9 +607,10 @@ static int cn700_mem_type(struct via_drm_priv *dev_priv,
 	return ret;
 }
 
-static int cx700_mem_type(struct via_drm_priv *dev_priv,
+static int cx700_mem_type(struct drm_device *dev,
 				struct pci_dev *fn3)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 type, clock;
 	int ret;
 
@@ -660,9 +667,10 @@ static int cx700_mem_type(struct via_drm_priv *dev_priv,
 	return ret;
 }
 
-static int vx900_mem_type(struct via_drm_priv *dev_priv,
+static int vx900_mem_type(struct drm_device *dev,
 				struct pci_dev *fn3)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	int ret;
 	u8 clock, type, volt;
 
@@ -731,14 +739,14 @@ static int vx900_mem_type(struct via_drm_priv *dev_priv,
 	return ret;
 }
 
-int via_vram_detect(struct via_drm_priv *dev_priv)
+int via_vram_detect(struct drm_device *dev)
 {
-	struct drm_device *dev = &dev_priv->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 via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 size;
 	int ret = 0;
 
@@ -776,7 +784,7 @@ int via_vram_detect(struct via_drm_priv *dev_priv)
 
 	/* CLE266 */
 	case PCI_DEVICE_ID_VIA_862X_0:
-		ret = cle266_mem_type(dev_priv, bridge);
+		ret = cle266_mem_type(dev, bridge);
 		if (ret)
 			goto out_err;
 
@@ -788,7 +796,7 @@ int via_vram_detect(struct via_drm_priv *dev_priv)
 
 	/* KM400 / KN400 / KM400A / KN400A */
 	case PCI_DEVICE_ID_VIA_8378_0:
-		ret = km400_mem_type(dev_priv, bridge);
+		ret = km400_mem_type(dev, bridge);
 
 		ret = pci_read_config_byte(bridge, 0xE1, &size);
 		if (ret)
@@ -798,7 +806,7 @@ int via_vram_detect(struct via_drm_priv *dev_priv)
 
 	/* P4M800 */
 	case PCI_DEVICE_ID_VIA_3296_0:
-		ret = p4m800_mem_type(dev_priv, bus, fn3);
+		ret = p4m800_mem_type(dev, bus, fn3);
 
 		ret = pci_read_config_byte(fn3, 0xA1, &size);
 		if (ret)
@@ -818,7 +826,7 @@ int via_vram_detect(struct via_drm_priv *dev_priv)
 		if (bridge->device == PCI_DEVICE_ID_VIA_VT3336)
 			dev_priv->vram_size <<= 2;
 
-		ret = km8xx_mem_type(dev_priv);
+		ret = km8xx_mem_type(dev);
 		if (ret)
 			goto out_err;
 		break;
@@ -830,7 +838,7 @@ int via_vram_detect(struct via_drm_priv *dev_priv)
 			goto out_err;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
 
-		ret = cn400_mem_type(dev_priv, bus, fn3);
+		ret = cn400_mem_type(dev, bus, fn3);
 		if (ret)
 			goto out_err;
 		break;
@@ -847,7 +855,7 @@ int via_vram_detect(struct via_drm_priv *dev_priv)
 		if (bridge->device != PCI_DEVICE_ID_VIA_P4M800CE)
 			dev_priv->vram_size <<= 2;
 
-		ret = cn700_mem_type(dev_priv, fn3);
+		ret = cn700_mem_type(dev, fn3);
 		if (ret)
 			goto out_err;
 		break;
@@ -865,7 +873,7 @@ int via_vram_detect(struct via_drm_priv *dev_priv)
 			goto out_err;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 22;
 
-		ret = cx700_mem_type(dev_priv, fn3);
+		ret = cx700_mem_type(dev, fn3);
 		if (ret)
 			goto out_err;
 		break;
@@ -877,7 +885,7 @@ int via_vram_detect(struct via_drm_priv *dev_priv)
 			goto out_err;
 		dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 22;
 
-		ret = vx900_mem_type(dev_priv, fn3);
+		ret = vx900_mem_type(dev, fn3);
 		if (ret)
 			goto out_err;
 		break;
@@ -958,10 +966,10 @@ out_err:
 	return ret;
 }
 
-static void via_quirks_init(struct via_drm_priv *dev_priv)
+static void via_quirks_init(struct drm_device *dev)
 {
-	struct drm_device *dev = &dev_priv->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
@@ -1012,8 +1020,9 @@ static void via_quirks_init(struct via_drm_priv *dev_priv)
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-int via_vram_init(struct via_drm_priv *dev_priv)
+static int via_vram_init(struct drm_device *dev)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	int ret = 0;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1026,8 +1035,10 @@ int via_vram_init(struct via_drm_priv *dev_priv)
 	return ret;
 }
 
-void via_vram_fini(struct via_drm_priv *dev_priv)
+static void via_vram_fini(struct drm_device *dev)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	if (dev_priv->vram_mtrr) {
@@ -1040,10 +1051,10 @@ void via_vram_fini(struct via_drm_priv *dev_priv)
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-int via_mmio_init(struct via_drm_priv *dev_priv)
+static int via_mmio_init(struct drm_device *dev)
 {
-	struct drm_device *dev = &dev_priv->dev;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	int ret = 0;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1068,8 +1079,10 @@ exit:
 	return ret;
 }
 
-void via_mmio_fini(struct via_drm_priv *dev_priv)
+static void via_mmio_fini(struct drm_device *dev)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	if (dev_priv->mmio) {
@@ -1080,8 +1093,9 @@ void via_mmio_fini(struct via_drm_priv *dev_priv)
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-void via_graphics_unlock(struct via_drm_priv *dev_priv)
+static void via_graphics_unlock(struct drm_device *dev)
 {
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	uint8_t temp;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1108,9 +1122,9 @@ void via_graphics_unlock(struct via_drm_priv *dev_priv)
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void via_chip_revision_info(struct via_drm_priv *dev_priv)
+static void via_chip_revision_info(struct drm_device *dev)
 {
-	struct drm_device *dev = &dev_priv->dev;
+	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	u8 tmp;
 
@@ -1159,15 +1173,15 @@ static void via_chip_revision_info(struct via_drm_priv *dev_priv)
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-int via_device_init(struct via_drm_priv *dev_priv)
+static int via_device_init(struct drm_device *dev)
 {
 	int ret;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_quirks_init(dev_priv);
+	via_quirks_init(dev);
 
-	ret = via_vram_detect(dev_priv);
+	ret = via_vram_detect(dev);
 	if (ret) {
 		DRM_ERROR("Failed to detect video RAM.\n");
 		goto exit;
@@ -1176,30 +1190,30 @@ int via_device_init(struct via_drm_priv *dev_priv)
 	/*
 	 * Map VRAM.
 	 */
-	ret = via_vram_init(dev_priv);
+	ret = via_vram_init(dev);
 	if (ret) {
 		DRM_ERROR("Failed to initialize video RAM.\n");
 		goto exit;
 	}
 
-	ret = via_mmio_init(dev_priv);
+	ret = via_mmio_init(dev);
 	if (ret) {
 		DRM_ERROR("Failed to initialize MMIO.\n");
 		goto exit;
 	}
 
-	via_graphics_unlock(dev_priv);
+	via_graphics_unlock(dev);
 exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
 }
 
-void via_device_fini(struct via_drm_priv *dev_priv)
+static void via_device_fini(struct drm_device *dev)
 {
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_mmio_fini(dev_priv);
-	via_vram_fini(dev_priv);
+	via_mmio_fini(dev);
+	via_vram_fini(dev);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
@@ -1210,10 +1224,8 @@ static const struct drm_mode_config_funcs via_drm_mode_config_funcs = {
 	.atomic_commit		= drm_atomic_helper_commit,
 };
 
-void via_mode_config_init(struct via_drm_priv *dev_priv)
+static void via_mode_config_init(struct drm_device *dev)
 {
-	struct drm_device *dev = &dev_priv->dev;
-
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	drm_mode_config_init(dev);
@@ -1240,7 +1252,7 @@ int via_modeset_init(struct drm_device *dev)
 	uint32_t i;
 	int ret = 0;
 
-	via_mode_config_init(dev_priv);
+	via_mode_config_init(dev);
 
 	/* Initialize the number of display connectors. */
 	dev_priv->number_fp = 0;
@@ -1310,7 +1322,7 @@ int via_drm_init(struct drm_device *dev)
 
 	dev_priv->vram_mtrr = -ENXIO;
 
-	ret = via_device_init(dev_priv);
+	ret = via_device_init(dev);
 	if (ret) {
 		DRM_ERROR("Failed to initialize Chrome IGP.\n");
 		goto exit;
@@ -1322,7 +1334,7 @@ int via_drm_init(struct drm_device *dev)
 		goto exit;
 	}
 
-	via_chip_revision_info(dev_priv);
+	via_chip_revision_info(dev);
 
 	ret = via_modeset_init(dev);
 	if (ret) {
@@ -1334,7 +1346,7 @@ int via_drm_init(struct drm_device *dev)
 error_modeset:
 	via_modeset_fini(dev);
 	via_mm_fini(dev_priv);
-	via_device_fini(dev_priv);
+	via_device_fini(dev);
 exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
@@ -1348,7 +1360,7 @@ void via_drm_fini(struct drm_device *dev)
 
 	via_modeset_fini(dev);
 	via_mm_fini(dev_priv);
-	via_device_fini(dev_priv);
+	via_device_fini(dev);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
commit 06dd16234a74b39d3f8474c90324583000c3d861
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:48:39 2023 -0700

    drm/via: Remove via_flag_init()
    
    Initialize use_dma32 input parameter of ttm_device_init() directly.
    
    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 24cfa82a60e9..07e2addfb36f 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -958,16 +958,6 @@ out_err:
 	return ret;
 }
 
-static void via_flag_init(struct via_drm_priv *dev_priv)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	/* Set this flag for ttm_bo_device_init. */
-	dev_priv->need_dma32 = true;
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
 static void via_quirks_init(struct via_drm_priv *dev_priv)
 {
 	struct drm_device *dev = &dev_priv->dev;
@@ -1175,7 +1165,6 @@ int via_device_init(struct via_drm_priv *dev_priv)
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	via_flag_init(dev_priv);
 	via_quirks_init(dev_priv);
 
 	ret = via_vram_detect(dev_priv);
diff --git a/drivers/gpu/drm/via/via_object.c b/drivers/gpu/drm/via/via_object.c
index d8e1fdf25db2..ea350da5968a 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -289,7 +289,7 @@ int via_mm_init(struct via_drm_priv *dev_priv)
 				dev->anon_inode->i_mapping,
 				dev->vma_offset_manager,
 				false,
-				dev_priv->need_dma32);
+				true);
 	if (ret) {
 		DRM_ERROR("Failed initializing buffer object driver.\n");
 		goto exit;
commit 20eb084197b349bddbe6e2d1b05e6470f471109a
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:48:38 2023 -0700

    drm/via: Use via_device_fini() when winding down device resources
    
    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 97695f862b3f..24cfa82a60e9 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1345,8 +1345,7 @@ int via_drm_init(struct drm_device *dev)
 error_modeset:
 	via_modeset_fini(dev);
 	via_mm_fini(dev_priv);
-	via_mmio_fini(dev_priv);
-	via_vram_fini(dev_priv);
+	via_device_fini(dev_priv);
 exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
@@ -1360,8 +1359,7 @@ void via_drm_fini(struct drm_device *dev)
 
 	via_modeset_fini(dev);
 	via_mm_fini(dev_priv);
-	via_mmio_fini(dev_priv);
-	via_vram_fini(dev_priv);
+	via_device_fini(dev_priv);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
commit 5a50890c481426ae325a3cbb81a430edb5980ebc
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:45:20 2023 -0700

    drm/via: Convert to drm_err() for via_i2c.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_i2c.c b/drivers/gpu/drm/via/via_i2c.c
index c87b46941420..228e6fd11b42 100644
--- a/drivers/gpu/drm/via/via_i2c.c
+++ b/drivers/gpu/drm/via/via_i2c.c
@@ -200,7 +200,7 @@ int via_i2c_init(struct drm_device *dev)
 
 		ret = create_i2c_bus(dev, i2c);
 		if (ret < 0)
-			DRM_ERROR("cannot create i2c bus %x:%d\n",
+			drm_err(dev, "cannot create i2c bus %x:%d\n",
 					ports[i], ret);
 		i2c++;
 	}
commit 51419edf081fe2b97d65f7d87de7251310428595
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:44:55 2023 -0700

    drm/via: Convert to drm_dbg_driver() for via_hdmi.c
    
    Discontinue the use of DRM_INFO().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_hdmi.c b/drivers/gpu/drm/via/via_hdmi.c
index 899023824e27..b01552e6b49e 100644
--- a/drivers/gpu/drm/via/via_hdmi.c
+++ b/drivers/gpu/drm/via/via_hdmi.c
@@ -263,7 +263,7 @@ static void via_hdmi_enc_mode_set(struct drm_encoder *encoder,
 	}
 
 	if (!connector) {
-		DRM_INFO("HDMI encoder is not used by any connector\n");
+		drm_dbg_driver(dev, "HDMI encoder is not used by any connector\n");
 		return;
 	}
 
commit 2ffcd55637d689e26294ee10da0f88eb8a5b1a3f
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:44:53 2023 -0700

    drm/via: Convert to drm_err() for via_hdmi.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_hdmi.c b/drivers/gpu/drm/via/via_hdmi.c
index fc4e0a90dd11..899023824e27 100644
--- a/drivers/gpu/drm/via/via_hdmi.c
+++ b/drivers/gpu/drm/via/via_hdmi.c
@@ -621,7 +621,7 @@ void via_hdmi_init(struct drm_device *dev, u32 di_port)
 
 	enc = kzalloc(sizeof(*enc) + 2 * sizeof(*hdmi), GFP_KERNEL);
 	if (!enc) {
-		DRM_ERROR("Failed to allocate connector and encoder\n");
+		drm_err(dev, "Failed to allocate connector and encoder\n");
 		return;
 	}
 	hdmi = &enc->cons[0];
commit fa04d58c0e18cb22b826b66295888568e1bfd6e2
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:44:51 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_drv.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    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 2c635e75c19a..facdba3656e8 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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 static void via_driver_postclose(struct drm_device *dev,
 					struct drm_file *file_priv)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_driver_lastclose(struct drm_device *dev)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	drm_fb_helper_lastclose(dev);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(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_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
commit a0b720162a1c8f229eb5e413e787041ed8891bf3
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:44:49 2023 -0700

    drm/via: Remove debug messages from via_init() and via_exit()
    
    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 77890de30bb1..2c635e75c19a 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -309,8 +309,6 @@ static int __init via_init(void)
 {
 	int ret = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
 	if ((via_modeset == -1) &&
 		(drm_firmware_drivers_only())) {
 		via_modeset = 0;
@@ -324,21 +322,16 @@ static int __init via_init(void)
 	ret = pci_register_driver(&via_pci_driver);
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
 }
 
 static void __exit via_exit(void)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
 	if (!via_modeset) {
-		goto exit;
+		return;
 	}
 
 	pci_unregister_driver(&via_pci_driver);
-exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
 module_init(via_init);
commit b6fc4d2e23a97dce95f9ebbf7e66fb10d9fbee26
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:44:48 2023 -0700

    drm/via: Convert via_pci_probe() and via_pci_remove() to use dev_info()
    
    Use dev_info() instead of DRM_DEBUG_KMS().
    
    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 3c78d4469e2c..77890de30bb1 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -235,7 +235,7 @@ static int via_pci_probe(struct pci_dev *pdev,
 	struct via_drm_priv *dev_priv;
 	int ret;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	dev_info(&pdev->dev, "Entered %s.\n", __func__);
 
 	ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev,
 								&via_driver);
@@ -276,7 +276,7 @@ static int via_pci_probe(struct pci_dev *pdev,
 error_disable_pci:
 	pci_disable_device(pdev);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	dev_info(&pdev->dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -284,12 +284,12 @@ static void via_pci_remove(struct pci_dev *pdev)
 {
 	struct drm_device *dev = pci_get_drvdata(pdev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	dev_info(&pdev->dev, "Entered %s.\n", __func__);
 
 	via_drm_fini(dev);
 	drm_dev_unregister(dev);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	dev_info(&pdev->dev, "Exiting %s.\n", __func__);
 }
 
 static const struct dev_pm_ops via_dev_pm_ops = {
commit 1a4709b619cede5d40cd0579efba29906a50f811
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:42:46 2023 -0700

    drm/via: Delete DRM_INFO() from via_dac_sync_polarity()
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index 87038fda9d15..9331b3509b11 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -59,10 +59,6 @@ static void via_dac_sync_polarity(struct via_drm_priv *dev_priv,
 	}
 
 	via_dac_set_sync_polarity(VGABASE, syncPolarity);
-	DRM_INFO("DAC (VGA) Horizontal Sync Polarity: %s\n",
-		(syncPolarity & BIT(0)) ? "-" : "+");
-	DRM_INFO("DAC (VGA) Vertical Sync Polarity: %s\n",
-		(syncPolarity & BIT(1)) ? "-" : "+");
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit 550f6de3f5cd26d2f075c4f7e137e76801113c17
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:42:45 2023 -0700

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

diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index 8abe1b4b23f3..87038fda9d15 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -67,24 +67,6 @@ static void via_dac_sync_polarity(struct via_drm_priv *dev_priv,
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
-/*
- * Sets DAC (VGA) display source.
- */
-static void via_dac_display_source(struct via_drm_priv *dev_priv,
-					int index)
-{
-	struct drm_device *dev = &dev_priv->dev;
-	u8 displaySource = index;
-
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
-
-	via_dac_set_display_source(VGABASE, displaySource & 0x01);
-	DRM_INFO("DAC (VGA) Display Source: IGA%d\n",
-			(displaySource & 0x01) + 1);
-
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
-}
-
 /*
  * Routines for controlling stuff on the DAC port
  */
@@ -153,7 +135,7 @@ static void via_dac_mode_set(struct drm_encoder *encoder,
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_dac_sync_polarity(dev_priv, adjusted_mode->flags);
-	via_dac_display_source(dev_priv, iga->index);
+	via_dac_set_display_source(VGABASE, iga->index);
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit 7c20a742d765ea3247acb98bacb0cca0c54657f7
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:42:43 2023 -0700

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

diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index bd9d045cd92e..8abe1b4b23f3 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -39,23 +39,6 @@
 #include "via_drv.h"
 
 
-/*
- * Enables or disables DAC (VGA) output.
- */
-static void via_dac_power(struct via_drm_priv *dev_priv, bool outputState)
-{
-	struct drm_device *dev = &dev_priv->dev;
-
-	drm_dbg_kms(dev, "Entered %s.\n", __func__);
-
-
-	via_dac_set_power(VGABASE, outputState);
-	DRM_INFO("DAC (VGA) Power: %s\n",
-			outputState ? "On" : "Off");
-
-	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
-}
-
 /*
  * Set DAC (VGA) sync polarity.
  */
@@ -122,19 +105,19 @@ static void via_dac_dpms(struct drm_encoder *encoder, int mode)
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
 		via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_ON);
-		via_dac_power(dev_priv, true);
+		via_dac_set_power(VGABASE, true);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 		via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_STANDBY);
-		via_dac_power(dev_priv, true);
+		via_dac_set_power(VGABASE, true);
 		break;
 	case DRM_MODE_DPMS_SUSPEND:
 		via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_SUSPEND);
-		via_dac_power(dev_priv, true);
+		via_dac_set_power(VGABASE, true);
 		break;
 	case DRM_MODE_DPMS_OFF:
 		via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_OFF);
-		via_dac_power(dev_priv, false);
+		via_dac_set_power(VGABASE, false);
 		break;
 	default:
 		drm_err(dev, "Bad DPMS mode.");
@@ -184,7 +167,7 @@ static void via_dac_prepare(struct drm_encoder *encoder)
 
 	if (encoder->crtc) {
 		via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_OFF);
-		via_dac_power(dev_priv, false);
+		via_dac_set_power(VGABASE, false);
 	}
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
@@ -199,7 +182,7 @@ static void via_dac_commit(struct drm_encoder *encoder)
 
 	if (encoder->crtc) {
 		via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_ON);
-		via_dac_power(dev_priv, true);
+		via_dac_set_power(VGABASE, true);
 	}
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
@@ -213,7 +196,7 @@ static void via_dac_disable(struct drm_encoder *encoder)
 	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_OFF);
-	via_dac_power(dev_priv, false);
+	via_dac_set_power(VGABASE, false);
 
 	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
commit a5ab631422444f45a14f9f33b6ad70fa4383adb9
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:42:41 2023 -0700

    drm/via: Convert to drm_err() for via_dac.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index 12d73d8e1954..bd9d045cd92e 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -137,7 +137,7 @@ static void via_dac_dpms(struct drm_encoder *encoder, int mode)
 		via_dac_power(dev_priv, false);
 		break;
 	default:
-		DRM_ERROR("Bad DPMS mode.");
+		drm_err(dev, "Bad DPMS mode.");
 		break;
 	}
 
@@ -484,7 +484,7 @@ void via_dac_init(struct drm_device *dev)
 
 	enc = kzalloc(sizeof(*enc) + sizeof(*con), GFP_KERNEL);
 	if (!enc) {
-		DRM_ERROR("Failed to allocate connector and encoder\n");
+		drm_err(dev, "Failed to allocate connector and encoder\n");
 		return;
 	}
 	con = &enc->cons[0];
commit 51b2cb51a12fdb319ebff12255537ce91f90f735
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:42:39 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_dac.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index 0ac26da1f798..12d73d8e1954 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -44,14 +44,16 @@
  */
 static void via_dac_power(struct via_drm_priv *dev_priv, bool outputState)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	struct drm_device *dev = &dev_priv->dev;
+
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 
 	via_dac_set_power(VGABASE, outputState);
 	DRM_INFO("DAC (VGA) Power: %s\n",
 			outputState ? "On" : "Off");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -60,9 +62,10 @@ static void via_dac_power(struct via_drm_priv *dev_priv, bool outputState)
 static void via_dac_sync_polarity(struct via_drm_priv *dev_priv,
 					unsigned int flags)
 {
+	struct drm_device *dev = &dev_priv->dev;
 	u8 syncPolarity = 0x00;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (flags & DRM_MODE_FLAG_NHSYNC) {
 		syncPolarity |= BIT(0);
@@ -78,7 +81,7 @@ static void via_dac_sync_polarity(struct via_drm_priv *dev_priv,
 	DRM_INFO("DAC (VGA) Vertical Sync Polarity: %s\n",
 		(syncPolarity & BIT(1)) ? "-" : "+");
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -87,15 +90,16 @@ static void via_dac_sync_polarity(struct via_drm_priv *dev_priv,
 static void via_dac_display_source(struct via_drm_priv *dev_priv,
 					int index)
 {
+	struct drm_device *dev = &dev_priv->dev;
 	u8 displaySource = index;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_dac_set_display_source(VGABASE, displaySource & 0x01);
 	DRM_INFO("DAC (VGA) Display Source: IGA%d\n",
 			(displaySource & 0x01) + 1);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /*
@@ -113,7 +117,7 @@ static void via_dac_dpms(struct drm_encoder *encoder, int mode)
 	struct drm_device *dev = encoder->dev;
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
@@ -137,7 +141,7 @@ static void via_dac_dpms(struct drm_encoder *encoder, int mode)
 		break;
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 /* Pass our mode to the connectors and the CRTC to give them a chance to
@@ -163,12 +167,12 @@ static void via_dac_mode_set(struct drm_encoder *encoder,
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_dac_sync_polarity(dev_priv, adjusted_mode->flags);
 	via_dac_display_source(dev_priv, iga->index);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_dac_prepare(struct drm_encoder *encoder)
@@ -176,14 +180,14 @@ static void via_dac_prepare(struct drm_encoder *encoder)
 	struct drm_device *dev = encoder->dev;
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (encoder->crtc) {
 		via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_OFF);
 		via_dac_power(dev_priv, false);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_dac_commit(struct drm_encoder *encoder)
@@ -191,14 +195,14 @@ static void via_dac_commit(struct drm_encoder *encoder)
 	struct drm_device *dev = encoder->dev;
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (encoder->crtc) {
 		via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_ON);
 		via_dac_power(dev_priv, true);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_dac_disable(struct drm_encoder *encoder)
@@ -206,12 +210,12 @@ static void via_dac_disable(struct drm_encoder *encoder)
 	struct drm_device *dev = encoder->dev;
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_OFF);
 	via_dac_power(dev_priv, false);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static const struct drm_encoder_helper_funcs via_dac_enc_helper_funcs = {
@@ -226,13 +230,14 @@ static const struct drm_encoder_helper_funcs via_dac_enc_helper_funcs = {
 static enum drm_connector_status
 via_dac_detect(struct drm_connector *connector, bool force)
 {
+	struct drm_device *dev = connector->dev;
 	struct via_connector *con = container_of(connector,
 					struct via_connector, base);
 	enum drm_connector_status ret = connector_status_disconnected;
 	struct i2c_adapter *i2c_bus;
 	struct edid *edid = NULL;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -271,7 +276,7 @@ via_dac_detect(struct drm_connector *connector, bool force)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -296,7 +301,7 @@ static enum drm_mode_status via_dac_mode_valid(
 	int min_clock, max_clock;
 	enum drm_mode_status status = MODE_OK;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	min_clock = 25000;
 	switch (pdev->device) {
@@ -352,20 +357,21 @@ static enum drm_mode_status via_dac_mode_valid(
 	}
 
 exit:
-	DRM_DEBUG_KMS("status: %u\n", status);
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "status: %u\n", status);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return status;
 }
 
 static int via_dac_get_modes(struct drm_connector *connector)
 {
+	struct drm_device *dev = connector->dev;
 	struct via_connector *con = container_of(connector,
 					struct via_connector, base);
 	int count = 0;
 	struct i2c_adapter *i2c_bus;
 	struct edid *edid = NULL;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (con->i2c_bus & VIA_I2C_BUS1) {
 		i2c_bus = via_find_ddc_bus(0x26);
@@ -408,7 +414,7 @@ static int via_dac_get_modes(struct drm_connector *connector)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return count;
 }
 
@@ -424,7 +430,7 @@ void via_dac_probe(struct drm_device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	u8 sr13, sr5a;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_UNICHROME_PRO_II:
@@ -432,20 +438,20 @@ void via_dac_probe(struct drm_device *dev)
 	case PCI_DEVICE_ID_VIA_CHROME9_HCM:
 	case PCI_DEVICE_ID_VIA_CHROME9_HD:
 		sr5a = vga_rseq(VGABASE, 0x5a);
-		DRM_DEBUG_KMS("SR5A: 0x%02x\n", sr5a);
+		drm_dbg_kms(dev, "SR5A: 0x%02x\n", sr5a);
 
 		/* Setting SR5A[0] to 1.
 		 * This allows the reading out the alternative
 		 * pin strapping information from SR12 and SR13. */
 		svga_wseq_mask(VGABASE, 0x5a, BIT(0), BIT(0));
-		DRM_DEBUG_KMS("SR5A: 0x%02x\n", sr5a);
+		drm_dbg_kms(dev, "SR5A: 0x%02x\n", sr5a);
 
 		sr13 = vga_rseq(VGABASE, 0x13);
-		DRM_DEBUG_KMS("SR13: 0x%02x\n", sr13);
+		drm_dbg_kms(dev, "SR13: 0x%02x\n", sr13);
 
 		if (!(sr13 & BIT(2))) {
 			dev_priv->dac_presence = true;
-			DRM_DEBUG_KMS("Detected the presence of VGA.\n");
+			drm_dbg_kms(dev, "Detected the presence of VGA.\n");
 		} else {
 			dev_priv->dac_presence = false;
 		}
@@ -455,7 +461,7 @@ void via_dac_probe(struct drm_device *dev)
 		break;
 	default:
 		dev_priv->dac_presence = true;
-		DRM_DEBUG_KMS("Detected the presence of VGA.\n");
+		drm_dbg_kms(dev, "Detected the presence of VGA.\n");
 		break;
 	}
 
@@ -467,7 +473,7 @@ void via_dac_probe(struct drm_device *dev)
 
 	dev_priv->mapped_i2c_bus |= dev_priv->dac_i2c_bus;
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 void via_dac_init(struct drm_device *dev)
commit c0373d744a66b24a8b660f3df5503fc6d0e19c18
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:42:37 2023 -0700

    drm/via: Convert to drm_err() for via_cursor.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_cursor.c b/drivers/gpu/drm/via/via_cursor.c
index a7815c120a5d..956d53052b78 100644
--- a/drivers/gpu/drm/via/via_cursor.c
+++ b/drivers/gpu/drm/via/via_cursor.c
@@ -317,6 +317,7 @@ static int via_cursor_atomic_check(struct drm_plane *plane,
 	struct drm_plane_state *new_plane_state =
 			drm_atomic_get_new_plane_state(state, plane);
 	struct drm_crtc_state *new_crtc_state;
+	struct drm_device *dev = plane->dev;
 	struct drm_framebuffer *fb = new_plane_state->fb;
 	int ret = 0;
 
@@ -325,7 +326,7 @@ static int via_cursor_atomic_check(struct drm_plane *plane,
 	}
 
 	if (fb->width != fb->height) {
-		DRM_ERROR("Hardware cursor is expected to have "
+		drm_err(dev, "Hardware cursor is expected to have "
 				"square dimensions.\n");
 		ret = -EINVAL;
 		goto exit;
commit 0d2742dc8c6acaee46c4440688c88c4564ed5dd4
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:35:45 2023 -0700

    drm/via: Convert to drm_err() for via_crtc.c
    
    Discontinue the use of DRM_ERROR().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index fc17b04938b1..b570fd7bdb4b 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -2220,7 +2220,7 @@ static int via_gamma_init(struct drm_crtc *crtc)
 
 	ret = drm_mode_crtc_set_gamma_size(crtc, 256);
 	if (ret) {
-		DRM_ERROR("Failed to set gamma size!\n");
+		drm_err(dev, "Failed to set gamma size!\n");
 		goto exit;
 	}
 
@@ -2256,7 +2256,7 @@ int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
 	primary = kzalloc(sizeof(struct drm_plane), GFP_KERNEL);
 	if (!primary) {
 		ret = -ENOMEM;
-		DRM_ERROR("Failed to allocate a primary plane.\n");
+		drm_err(dev, "Failed to allocate a primary plane.\n");
 		goto exit;
 	}
 
@@ -2268,7 +2268,7 @@ int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
 			ARRAY_SIZE(via_primary_formats),
 			NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
 	if (ret) {
-		DRM_ERROR("Failed to initialize a primary "
+		drm_err(dev, "Failed to initialize a primary "
 				"plane.\n");
 		goto free_primary;
 	}
@@ -2276,7 +2276,7 @@ int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
 	cursor = kzalloc(sizeof(struct drm_plane), GFP_KERNEL);
 	if (!cursor) {
 		ret = -ENOMEM;
-		DRM_ERROR("Failed to allocate a cursor plane.\n");
+		drm_err(dev, "Failed to allocate a cursor plane.\n");
 		goto cleanup_primary;
 	}
 
@@ -2288,7 +2288,7 @@ int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
 			via_cursor_formats_size,
 			NULL, DRM_PLANE_TYPE_CURSOR, NULL);
 	if (ret) {
-		DRM_ERROR("Failed to initialize a cursor "
+		drm_err(dev, "Failed to initialize a cursor "
 				"plane.\n");
 		goto free_cursor;
 	}
@@ -2296,7 +2296,7 @@ int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
 	iga = kzalloc(sizeof(struct via_crtc), GFP_KERNEL);
 	if (!iga) {
 		ret = -ENOMEM;
-		DRM_ERROR("Failed to allocate CRTC storage.\n");
+		drm_err(dev, "Failed to allocate CRTC storage.\n");
 		goto cleanup_cursor;
 	}
 
@@ -2307,7 +2307,7 @@ int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
 					&via_drm_crtc_funcs,
 					NULL);
 	if (ret) {
-		DRM_ERROR("Failed to initialize CRTC!\n");
+		drm_err(dev, "Failed to initialize CRTC!\n");
 		goto free_crtc;
 	}
 
commit f60e063dd43c4f5e33445d9add0992e1b03c594d
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:35:43 2023 -0700

    drm/via: Convert to drm_dbg_kms() for via_crtc.c
    
    Discontinue the use of DRM_DEBUG_KMS().
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 16377e6d840f..fc17b04938b1 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -70,7 +70,7 @@ static void via_iga_common_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_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/* Be careful with 3C5.15[5] - Wrap Around Disable.
 	 * It must be set to 1 for proper operation. */
@@ -102,7 +102,7 @@ static void via_iga_common_init(struct drm_device *dev)
 	 */
 	svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_iga1_set_color_depth(struct drm_device *dev,
@@ -111,7 +111,7 @@ static void via_iga1_set_color_depth(struct drm_device *dev,
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 data;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	data = 0x00;
 
@@ -143,7 +143,7 @@ static void via_iga1_set_color_depth(struct drm_device *dev,
 	 */
 	svga_wseq_mask(VGABASE, 0x15, data, BIT(4) | BIT(3) | BIT(2));
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_iga2_set_color_depth(struct drm_device *dev,
@@ -152,7 +152,7 @@ static void via_iga2_set_color_depth(struct drm_device *dev,
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	u8 data;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	data = 0x00;
 
@@ -179,7 +179,7 @@ static void via_iga2_set_color_depth(struct drm_device *dev,
 	 */
 	svga_wcrt_mask(VGABASE, 0x67, data, BIT(7) | BIT(6));
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static int via_gamma_set(struct drm_crtc *crtc,
@@ -196,7 +196,7 @@ static int via_gamma_set(struct drm_crtc *crtc,
 	u8 val = 0;
 	int ret = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if ((!crtc->enabled) || (!crtc->primary->fb)) {
 		ret = -EINVAL;
@@ -332,7 +332,7 @@ static int via_gamma_set(struct drm_crtc *crtc,
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -404,7 +404,7 @@ static int via_iga1_display_fifo_regs(struct drm_device *dev,
 	bool enable_extended_display_fifo = false;
 	int ret = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_CLE266_GFX:
@@ -787,7 +787,7 @@ static int via_iga1_display_fifo_regs(struct drm_device *dev,
 	load_value_to_registers(VGABASE, &iga->display_queue, reg_value);
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -806,7 +806,7 @@ static int via_iga2_display_fifo_regs(struct drm_device *dev,
 	bool enable_extended_display_fifo = false;
 	int ret = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	switch (pdev->device) {
 	case PCI_DEVICE_ID_VIA_CLE266_GFX:
@@ -1101,7 +1101,7 @@ static int via_iga2_display_fifo_regs(struct drm_device *dev,
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
@@ -1593,7 +1593,7 @@ void via_mode_set_nofb(struct drm_crtc *crtc)
 	u8 reg_value = 0;
 	int ret;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	/* Load standard registers */
 	via_load_vpit_regs(dev_priv);
@@ -1790,7 +1790,7 @@ void via_mode_set_nofb(struct drm_crtc *crtc)
 		svga_wcrt_mask(VGABASE, 0x6A, BIT(7), BIT(7));
 	}
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_crtc_helper_atomic_enable(struct drm_crtc *crtc,
@@ -1801,7 +1801,7 @@ static void via_crtc_helper_atomic_enable(struct drm_crtc *crtc,
 	struct via_crtc *iga = container_of(crtc,
 						struct via_crtc, base);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (!iga->index) {
 		svga_wseq_mask(VGABASE, 0x01, 0x00, BIT(5));
@@ -1809,7 +1809,7 @@ static void via_crtc_helper_atomic_enable(struct drm_crtc *crtc,
 		svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(2));
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static void via_crtc_helper_atomic_disable(struct drm_crtc *crtc,
@@ -1820,7 +1820,7 @@ static void via_crtc_helper_atomic_disable(struct drm_crtc *crtc,
 	struct via_crtc *iga = container_of(crtc,
 						struct via_crtc, base);
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (!iga->index) {
 		svga_wseq_mask(VGABASE, 0x01, BIT(5), BIT(5));
@@ -1828,7 +1828,7 @@ static void via_crtc_helper_atomic_disable(struct drm_crtc *crtc,
 		svga_wcrt_mask(VGABASE, 0x6B, BIT(2), BIT(2));
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static const struct drm_crtc_helper_funcs via_drm_crtc_helper_funcs = {
@@ -1849,7 +1849,7 @@ static int via_primary_atomic_check(struct drm_plane *plane,
 	uint32_t frame_buffer_size;
 	int ret = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if ((!new_plane_state->crtc) || (!new_plane_state->visible)) {
 		goto exit;
@@ -1877,16 +1877,18 @@ static int via_primary_atomic_check(struct drm_plane *plane,
 					DRM_PLANE_NO_SCALING,
 					false, true);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 static void via_primary_atomic_disable(struct drm_plane *plane,
 					struct drm_atomic_state *state)
 {
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	struct drm_device *dev = plane->dev;
+
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return;
 }
 
@@ -1907,7 +1909,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
 	struct ttm_buffer_object *ttm_bo;
 	struct via_bo *bo;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	gem = fb->obj[0];
 	ttm_bo = container_of(gem, struct ttm_buffer_object, base);
@@ -1963,18 +1965,19 @@ void via_primary_atomic_update(struct drm_plane *plane,
 		load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
 	}
 
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static int via_primary_prepare_fb(struct drm_plane *plane,
 				struct drm_plane_state *new_state)
 {
+	struct drm_device *dev = plane->dev;
 	struct drm_gem_object *gem;
 	struct ttm_buffer_object *ttm_bo;
 	struct via_bo *bo;
 	int ret = 0;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (!new_state->fb) {
 		goto exit;
@@ -1992,19 +1995,20 @@ static int via_primary_prepare_fb(struct drm_plane *plane,
 	ret = via_bo_pin(bo, TTM_PL_VRAM);
 	ttm_bo_unreserve(ttm_bo);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
 static void via_primary_cleanup_fb(struct drm_plane *plane,
 				struct drm_plane_state *old_state)
 {
+	struct drm_device *dev = plane->dev;
 	struct drm_gem_object *gem;
 	struct ttm_buffer_object *ttm_bo;
 	struct via_bo *bo;
 	int ret;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	if (!old_state->fb) {
 		goto exit;
@@ -2022,7 +2026,7 @@ static void via_primary_cleanup_fb(struct drm_plane *plane,
 	via_bo_unpin(bo);
 	ttm_bo_unreserve(ttm_bo);
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 }
 
 static const struct drm_plane_helper_funcs
@@ -2207,11 +2211,12 @@ static void via_crtc_param_init(struct via_drm_priv *dev_priv,
 
 static int via_gamma_init(struct drm_crtc *crtc)
 {
+	struct drm_device *dev = crtc->dev;
 	u16 *gamma;
 	uint32_t i;
 	int ret;
 
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+	drm_dbg_kms(dev, "Entered %s.\n", __func__);
 
 	ret = drm_mode_crtc_set_gamma_size(crtc, 256);
 	if (ret) {
@@ -2227,7 +2232,7 @@ static int via_gamma_init(struct drm_crtc *crtc)
 	}
 
 exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	drm_dbg_kms(dev, "Exiting %s.\n", __func__);
 	return ret;
 }
 
commit f5438710df9a94668fe8c04bc268a1a63c418679
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:34:19 2023 -0700

    drm/via: Migrate digital Tx encoding code into via_tx.c
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/Makefile b/drivers/gpu/drm/via/Makefile
index 1553e5784ebc..7acc04ebe995 100644
--- a/drivers/gpu/drm/via/Makefile
+++ b/drivers/gpu/drm/via/Makefile
@@ -21,6 +21,7 @@ via-y := via_connector.o \
 		via_sii164.o \
 		via_tmds.o \
 		via_ttm.o \
+		via_tx.o \
 		via_vt1632.o
 
 obj-$(CONFIG_DRM_VIA)	+= via.o
diff --git a/drivers/gpu/drm/via/via_encoder.c b/drivers/gpu/drm/via/via_encoder.c
index 5418a9257bf8..8782329e2740 100644
--- a/drivers/gpu/drm/via/via_encoder.c
+++ b/drivers/gpu/drm/via/via_encoder.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2017-2018 Kevin Brace.
+ * Copyright 2012 James Simmons. All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  *
  * Author(s):
- * Kevin Brace <kevinbrace at bracecomputerlab.com>
+ * James Simmons <jsimmons at infradead.org>
  */
 
 #include <drm/drm_encoder.h>
@@ -29,199 +29,6 @@
 #include "via_drv.h"
 
 
-void via_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
-						uint32_t di_port,
-						bool io_pad_on)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	switch(di_port) {
-	case VIA_DI_PORT_DIP0:
-		via_dip0_set_io_pad_state(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	case VIA_DI_PORT_DIP1:
-		via_dip1_set_io_pad_state(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	case VIA_DI_PORT_DVP0:
-		via_dvp0_set_io_pad_state(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	case VIA_DI_PORT_DVP1:
-		via_dvp1_set_io_pad_state(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	case VIA_DI_PORT_FPDPLOW:
-		via_fpdp_low_set_io_pad_state(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	case VIA_DI_PORT_FPDPHIGH:
-		via_fpdp_high_set_io_pad_state(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	case (VIA_DI_PORT_FPDPLOW |
-		VIA_DI_PORT_FPDPHIGH):
-		via_fpdp_low_set_io_pad_state(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		via_fpdp_high_set_io_pad_state(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	case VIA_DI_PORT_LVDS1:
-		via_lvds1_set_io_pad_setting(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	case VIA_DI_PORT_LVDS2:
-		via_lvds2_set_io_pad_setting(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	case (VIA_DI_PORT_LVDS1 |
-		VIA_DI_PORT_LVDS2):
-		via_lvds1_set_io_pad_setting(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		via_lvds2_set_io_pad_setting(VGABASE,
-					io_pad_on ? 0x03 : 0x00);
-		break;
-	default:
-		break;
-	}
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-void via_output_enable(struct via_drm_priv *dev_priv, uint32_t di_port,
-			bool output_enable)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	switch(di_port) {
-	case VIA_DI_PORT_DIP0:
-		via_dip0_set_output_enable(VGABASE, output_enable);
-		break;
-	case VIA_DI_PORT_DIP1:
-		via_dip1_set_output_enable(VGABASE, output_enable);
-		break;
-	default:
-		break;
-	}
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-void via_clock_source(struct via_drm_priv *dev_priv, uint32_t di_port,
-			bool clock_source)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	switch(di_port) {
-	case VIA_DI_PORT_DIP0:
-		via_dip0_set_clock_source(VGABASE, clock_source);
-		break;
-	case VIA_DI_PORT_DIP1:
-		via_dip1_set_clock_source(VGABASE, clock_source);
-		break;
-	default:
-		break;
-	}
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-void via_transmitter_clock_drive_strength(
-					struct via_drm_priv *dev_priv,
-					u32 di_port, u8 drive_strength)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	switch(di_port) {
-	case VIA_DI_PORT_DVP0:
-		via_dvp0_set_clock_drive_strength(VGABASE,
-						drive_strength);
-		break;
-	case VIA_DI_PORT_DVP1:
-		via_dvp1_set_clock_drive_strength(VGABASE,
-						drive_strength);
-		break;
-	default:
-		break;
-	}
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-void via_transmitter_data_drive_strength(
-					struct via_drm_priv *dev_priv,
-					u32 di_port, u8 drive_strength)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	switch(di_port) {
-	case VIA_DI_PORT_DVP0:
-		via_dvp0_set_data_drive_strength(VGABASE,
-						drive_strength);
-		break;
-	case VIA_DI_PORT_DVP1:
-		via_dvp1_set_data_drive_strength(VGABASE,
-						drive_strength);
-		break;
-	default:
-		break;
-	}
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-void via_transmitter_display_source(struct via_drm_priv *dev_priv,
-						u32 di_port, int index)
-{
-	u8 display_source = index & 0x01;
-
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	switch(di_port) {
-	case VIA_DI_PORT_DIP0:
-		via_dip0_set_display_source(VGABASE, display_source);
-		break;
-	case VIA_DI_PORT_DIP1:
-		via_dip1_set_display_source(VGABASE, display_source);
-		break;
-	case VIA_DI_PORT_DVP0:
-		via_dvp0_set_display_source(VGABASE, display_source);
-		break;
-	case VIA_DI_PORT_DVP1:
-		via_dvp1_set_display_source(VGABASE, display_source);
-		break;
-	case VIA_DI_PORT_FPDPLOW:
-		via_fpdp_low_set_display_source(VGABASE, display_source);
-		via_dvp1_set_display_source(VGABASE, display_source);
-		break;
-	case VIA_DI_PORT_FPDPHIGH:
-		via_fpdp_high_set_display_source(VGABASE, display_source);
-		via_dvp0_set_display_source(VGABASE, display_source);
-		break;
-	case (VIA_DI_PORT_FPDPLOW |
-		VIA_DI_PORT_FPDPHIGH):
-		via_fpdp_low_set_display_source(VGABASE, display_source);
-		via_fpdp_high_set_display_source(VGABASE, display_source);
-		break;
-	case VIA_DI_PORT_LVDS1:
-		via_lvds1_set_display_source(VGABASE, display_source);
-		break;
-	case VIA_DI_PORT_LVDS2:
-		via_lvds2_set_display_source(VGABASE, display_source);
-		break;
-	case (VIA_DI_PORT_LVDS1 |
-		VIA_DI_PORT_LVDS2):
-		via_lvds1_set_display_source(VGABASE, display_source);
-		via_lvds2_set_display_source(VGABASE, display_source);
-		break;
-	default:
-		break;
-	}
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
 void via_encoder_destroy(struct drm_encoder *encoder)
 {
 	struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
diff --git a/drivers/gpu/drm/via/via_tx.c b/drivers/gpu/drm/via/via_tx.c
new file mode 100644
index 000000000000..60c3253239eb
--- /dev/null
+++ b/drivers/gpu/drm/via/via_tx.c
@@ -0,0 +1,221 @@
+/*
+ * Copyright © 2017-2018 Kevin Brace.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author(s):
+ * Kevin Brace <kevinbrace at bracecomputerlab.com>
+ */
+
+#include "via_drv.h"
+
+
+void via_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
+						uint32_t di_port,
+						bool io_pad_on)
+{
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	switch(di_port) {
+	case VIA_DI_PORT_DIP0:
+		via_dip0_set_io_pad_state(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	case VIA_DI_PORT_DIP1:
+		via_dip1_set_io_pad_state(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	case VIA_DI_PORT_DVP0:
+		via_dvp0_set_io_pad_state(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	case VIA_DI_PORT_DVP1:
+		via_dvp1_set_io_pad_state(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	case VIA_DI_PORT_FPDPLOW:
+		via_fpdp_low_set_io_pad_state(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	case VIA_DI_PORT_FPDPHIGH:
+		via_fpdp_high_set_io_pad_state(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	case (VIA_DI_PORT_FPDPLOW |
+		VIA_DI_PORT_FPDPHIGH):
+		via_fpdp_low_set_io_pad_state(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		via_fpdp_high_set_io_pad_state(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	case VIA_DI_PORT_LVDS1:
+		via_lvds1_set_io_pad_setting(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	case VIA_DI_PORT_LVDS2:
+		via_lvds2_set_io_pad_setting(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	case (VIA_DI_PORT_LVDS1 |
+		VIA_DI_PORT_LVDS2):
+		via_lvds1_set_io_pad_setting(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		via_lvds2_set_io_pad_setting(VGABASE,
+					io_pad_on ? 0x03 : 0x00);
+		break;
+	default:
+		break;
+	}
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+void via_output_enable(struct via_drm_priv *dev_priv, uint32_t di_port,
+			bool output_enable)
+{
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	switch(di_port) {
+	case VIA_DI_PORT_DIP0:
+		via_dip0_set_output_enable(VGABASE, output_enable);
+		break;
+	case VIA_DI_PORT_DIP1:
+		via_dip1_set_output_enable(VGABASE, output_enable);
+		break;
+	default:
+		break;
+	}
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+void via_clock_source(struct via_drm_priv *dev_priv, uint32_t di_port,
+			bool clock_source)
+{
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	switch(di_port) {
+	case VIA_DI_PORT_DIP0:
+		via_dip0_set_clock_source(VGABASE, clock_source);
+		break;
+	case VIA_DI_PORT_DIP1:
+		via_dip1_set_clock_source(VGABASE, clock_source);
+		break;
+	default:
+		break;
+	}
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+void via_transmitter_clock_drive_strength(
+					struct via_drm_priv *dev_priv,
+					u32 di_port, u8 drive_strength)
+{
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	switch(di_port) {
+	case VIA_DI_PORT_DVP0:
+		via_dvp0_set_clock_drive_strength(VGABASE,
+						drive_strength);
+		break;
+	case VIA_DI_PORT_DVP1:
+		via_dvp1_set_clock_drive_strength(VGABASE,
+						drive_strength);
+		break;
+	default:
+		break;
+	}
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+void via_transmitter_data_drive_strength(
+					struct via_drm_priv *dev_priv,
+					u32 di_port, u8 drive_strength)
+{
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	switch(di_port) {
+	case VIA_DI_PORT_DVP0:
+		via_dvp0_set_data_drive_strength(VGABASE,
+						drive_strength);
+		break;
+	case VIA_DI_PORT_DVP1:
+		via_dvp1_set_data_drive_strength(VGABASE,
+						drive_strength);
+		break;
+	default:
+		break;
+	}
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+void via_transmitter_display_source(struct via_drm_priv *dev_priv,
+						u32 di_port, int index)
+{
+	u8 display_source = index & 0x01;
+
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	switch(di_port) {
+	case VIA_DI_PORT_DIP0:
+		via_dip0_set_display_source(VGABASE, display_source);
+		break;
+	case VIA_DI_PORT_DIP1:
+		via_dip1_set_display_source(VGABASE, display_source);
+		break;
+	case VIA_DI_PORT_DVP0:
+		via_dvp0_set_display_source(VGABASE, display_source);
+		break;
+	case VIA_DI_PORT_DVP1:
+		via_dvp1_set_display_source(VGABASE, display_source);
+		break;
+	case VIA_DI_PORT_FPDPLOW:
+		via_fpdp_low_set_display_source(VGABASE, display_source);
+		via_dvp1_set_display_source(VGABASE, display_source);
+		break;
+	case VIA_DI_PORT_FPDPHIGH:
+		via_fpdp_high_set_display_source(VGABASE, display_source);
+		via_dvp0_set_display_source(VGABASE, display_source);
+		break;
+	case (VIA_DI_PORT_FPDPLOW |
+		VIA_DI_PORT_FPDPHIGH):
+		via_fpdp_low_set_display_source(VGABASE, display_source);
+		via_fpdp_high_set_display_source(VGABASE, display_source);
+		break;
+	case VIA_DI_PORT_LVDS1:
+		via_lvds1_set_display_source(VGABASE, display_source);
+		break;
+	case VIA_DI_PORT_LVDS2:
+		via_lvds2_set_display_source(VGABASE, display_source);
+		break;
+	case (VIA_DI_PORT_LVDS1 |
+		VIA_DI_PORT_LVDS2):
+		via_lvds1_set_display_source(VGABASE, display_source);
+		via_lvds2_set_display_source(VGABASE, display_source);
+		break;
+	default:
+		break;
+	}
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
commit 6a374b883b6c04ab92a1a40dae293f63c86c4e83
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon May 22 08:26:13 2023 -0700

    drm/via: Remove DRM_DEBUG_KMS() from via_crtc_hw.h
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_crtc_hw.h b/drivers/gpu/drm/via/via_crtc_hw.h
index 4a6b785324bd..241dd6d11026 100644
--- a/drivers/gpu/drm/via/via_crtc_hw.h
+++ b/drivers/gpu/drm/via/via_crtc_hw.h
@@ -104,8 +104,6 @@ via_iga1_set_palette_lut_resolution(void __iomem *regs,
 	 *             0: 6-bit
 	 *             1: 8-bit */
 	svga_wseq_mask(regs, 0x15, palette_lut ? BIT(7) : 0x00, BIT(7));
-	DRM_DEBUG_KMS("IGA1 Palette LUT Resolution: %s bit\n",
-			palette_lut ? "8" : "6");
 }
 
 static inline void
@@ -117,8 +115,6 @@ via_iga2_set_palette_lut_resolution(void __iomem *regs,
 	 *             0: 6-bit
 	 *             1: 8-bit */
 	svga_wcrt_mask(regs, 0x6a, palette_lut ? BIT(5) : 0x00, BIT(5));
-	DRM_DEBUG_KMS("IGA2 Palette LUT Resolution: %s bit\n",
-			palette_lut ? "8" : "6");
 }
 
 static inline void
@@ -126,8 +122,6 @@ via_iga1_set_interlace_mode(void __iomem *regs, bool interlace_mode)
 {
 	svga_wcrt_mask(regs, 0x33,
 			interlace_mode ? BIT(6) : 0x00, BIT(6));
-	DRM_DEBUG_KMS("IGA1 Interlace Mode: %s\n",
-			interlace_mode ? "On" : "Off");
 }
 
 static inline void
@@ -135,8 +129,6 @@ via_iga2_set_interlace_mode(void __iomem *regs, bool interlace_mode)
 {
 	svga_wcrt_mask(regs, 0x67,
 			interlace_mode ? BIT(5) : 0x00, BIT(5));
-	DRM_DEBUG_KMS("IGA2 Interlace Mode: %s\n",
-			interlace_mode ? "On" : "Off");
 }
 
 /*
@@ -147,8 +139,6 @@ via_iga1_set_hsync_shift(void __iomem *regs, u8 shift_value)
 {
 	/* 3X5.33[2:0] - IGA1 HSYNC Shift */
 	svga_wcrt_mask(regs, 0x33, shift_value, BIT(2) | BIT(1) | BIT(0));
-	DRM_DEBUG_KMS("IGA1 HSYNC Shift: %u\n",
-				(shift_value & 0x07));
 }
 
 /*
@@ -164,11 +154,6 @@ via_dip0_set_io_pad_state(void __iomem *regs, u8 io_pad_state)
 	 *               11: Pad on/off according to the
 	 *                   Power Management Status (PMS) */
 	svga_wseq_mask(regs, 0x1E, io_pad_state << 6, BIT(7) | BIT(6));
-	DRM_DEBUG_KMS("DIP0 I/O Pad State: %s\n",
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x03) ? "On" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x02) ? "Conditional" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x01) ? "Off" :
-								       "Off");
 }
 
 /*
@@ -184,8 +169,6 @@ via_dip0_set_output_enable(void __iomem *regs, bool output_enable)
 	*             1: Output Enable
 	*/
 	svga_wcrt_mask(regs, 0x6c, output_enable ? BIT(0) : 0x00, BIT(0));
-	DRM_DEBUG_KMS("DIP0 Output: %s\n",
-			output_enable ? "Enable" : "Disable");
 }
 
 /*
@@ -201,8 +184,6 @@ via_dip0_set_clock_source(void __iomem *regs, bool clock_source)
 	 *             1: Internal
 	 */
 	svga_wcrt_mask(regs, 0x6c, clock_source ? BIT(5) : 0x00, BIT(5));
-	DRM_DEBUG_KMS("DIP0 Clock Source: %s\n",
-			clock_source ? "Internal" : "External");
 }
 
 /*
@@ -218,8 +199,6 @@ via_dip0_set_display_source(void __iomem *regs, u8 display_source)
 	 *             1: Secondary Display
 	 */
 	svga_wcrt_mask(regs, 0x6c, display_source << 7, BIT(7));
-	DRM_DEBUG_KMS("DIP0 Display Source: IGA%d\n",
-			(display_source & 0x01) + 1);
 }
 
 /*
@@ -235,11 +214,6 @@ via_dip1_set_io_pad_state(void __iomem *regs, u8 io_pad_state)
 	 *               11: I/O pad on
 	 */
 	svga_wseq_mask(regs, 0x1e, io_pad_state << 4, BIT(5) | BIT(4));
-	DRM_DEBUG_KMS("DIP1 I/O Pad State: %s\n",
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x03) ? "On" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x02) ? "Conditional" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x01) ? "Off" :
-									"Off");
 }
 
 /*
@@ -255,8 +229,6 @@ via_dip1_set_output_enable(void __iomem *regs, bool output_enable)
 	 *             1: Output Enable
 	 */
 	svga_wcrt_mask(regs, 0x93, output_enable ? BIT(0) : 0x00, BIT(0));
-	DRM_DEBUG_KMS("DIP1 Output: %s\n",
-			output_enable ? "Enable" : "Disable");
 }
 
 /*
@@ -272,8 +244,6 @@ via_dip1_set_clock_source(void __iomem *regs, bool clock_source)
 	 *             1: Internal
 	 */
 	svga_wcrt_mask(regs, 0x93, clock_source ? BIT(5) : 0x00, BIT(5));
-	DRM_DEBUG_KMS("DIP1 Clock Source: %s\n",
-			clock_source ? "Internal" : "External");
 }
 
 /*
@@ -289,8 +259,6 @@ via_dip1_set_display_source(void __iomem *regs, u8 display_source)
 	 *             1: IGA2
 	 */
 	svga_wcrt_mask(regs, 0x93, display_source << 7, BIT(7));
-	DRM_DEBUG_KMS("DIP1 Display Source: IGA%d\n",
-			(display_source & 0x01) + 1);
 }
 
 /*
@@ -305,11 +273,6 @@ via_dvp0_set_io_pad_state(void __iomem *regs, u8 io_pad_state)
 	 *               11: Pad on/off according to the
 	 *                   Power Management Status (PMS) */
 	svga_wseq_mask(regs, 0x1E, io_pad_state << 6, BIT(7) | BIT(6));
-	DRM_DEBUG_KMS("DVP0 I/O Pad State: %s\n",
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x03) ? "On" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x02) ? "Conditional" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x01) ? "Off" :
-								       "Off");
 }
 
 /*
@@ -326,9 +289,6 @@ via_dvp0_set_clock_drive_strength(void __iomem *regs,
 	/* 3C5.2A[4] - DVP0 Clock Drive Strength Bit [1] */
 	svga_wseq_mask(regs, 0x2A,
 			clock_drive_strength << 3, BIT(4));
-
-	DRM_DEBUG_KMS("DVP0 Clock I/O Pad Drive Strength: %lu\n",
-			clock_drive_strength & (BIT(1) | BIT(0)));
 }
 
 /*
@@ -345,9 +305,6 @@ via_dvp0_set_data_drive_strength(void __iomem *regs,
 	/* 3C5.2A[5] - DVP0 Data Drive Strength Bit [1] */
 	svga_wseq_mask(regs, 0x2A,
 			data_drive_strength << 4, BIT(5));
-
-	DRM_DEBUG_KMS("DVP0 Data I/O Pads Drive Strength: %lu\n",
-			data_drive_strength & (BIT(1) | BIT(0)));
 }
 
 /*
@@ -360,8 +317,6 @@ via_dvp0_set_display_source(void __iomem *regs, u8 display_source)
 	 *             0: Primary Display
 	 *             1: Secondary Display */
 	svga_wcrt_mask(regs, 0x96, display_source << 4, BIT(4));
-	DRM_DEBUG_KMS("DVP0 Display Source: IGA%d\n",
-			(display_source & 0x01) + 1);
 }
 
 /*
@@ -376,11 +331,6 @@ via_dvp1_set_io_pad_state(void __iomem *regs, u8 io_pad_state)
 	 *               11: Pad on/off according to the
 	 *                   Power Management Status (PMS) */
 	svga_wseq_mask(regs, 0x1E, io_pad_state << 4, BIT(5) | BIT(4));
-	DRM_DEBUG_KMS("DVP1 I/O Pad State: %s\n",
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x03) ? "On" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x02) ? "Conditional" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x01) ? "Off" :
-								       "Off");
 }
 
 /*
@@ -397,8 +347,6 @@ via_dvp1_set_clock_drive_strength(void __iomem *regs,
 	 *               11: highest */
 	svga_wseq_mask(regs, 0x65,
 			clock_drive_strength << 2, BIT(3) | BIT(2));
-	DRM_DEBUG_KMS("DVP1 Clock I/O Pad Drive Strength: %lu\n",
-			clock_drive_strength & (BIT(1) | BIT(0)));
 }
 
 /*
@@ -415,8 +363,6 @@ via_dvp1_set_data_drive_strength(void __iomem *regs,
 	 *               11: highest */
 	svga_wseq_mask(regs, 0x65,
 			data_drive_strength, BIT(1) | BIT(0));
-	DRM_DEBUG_KMS("DVP1 Data I/O Pads Drive Strength: %lu\n",
-			data_drive_strength & (BIT(1) | BIT(0)));
 }
 
 /*
@@ -429,8 +375,6 @@ via_dvp1_set_display_source(void __iomem *regs, u8 display_source)
 	 *             0: Primary Display
 	 *             1: Secondary Display */
 	svga_wcrt_mask(regs, 0x9B, display_source << 4, BIT(4));
-	DRM_DEBUG_KMS("DVP1 Display Source: IGA%d\n",
-			(display_source & 0x01) + 1);
 }
 
 /*
@@ -443,8 +387,6 @@ static inline void via_dac_set_power(void __iomem *regs, bool output_state)
 	 *             1: DAC off */
 	svga_wcrt_mask(regs, 0x47,
 			output_state ? 0x00 : BIT(2), BIT(2));
-	DRM_DEBUG_KMS("Analog (VGA) Power: %s\n",
-			output_state ? "On" : "Off");
 }
 
 /*
@@ -460,14 +402,6 @@ static inline void via_dac_set_dpms_control(void __iomem *regs,
 	 *               11: Off */
 	svga_wcrt_mask(regs, 0x36,
 			dpms_control << 4, BIT(5) | BIT(4));
-	DRM_DEBUG_KMS("Analog (VGA) DPMS: %s\n",
-			((dpms_control & (BIT(1) | BIT(0))) == 0x03) ?
-				"Off" :
-			((dpms_control & (BIT(1) | BIT(0))) == 0x02) ?
-				"Suspend" :
-			((dpms_control & (BIT(1) | BIT(0))) == 0x01) ?
-				"Standby" :
-				"On");
 }
 
 /*
@@ -484,10 +418,6 @@ static inline void via_dac_set_sync_polarity(void __iomem *regs,
 	 *          1: Negative */
 	svga_wmisc_mask(regs,
 			sync_polarity << 6, (BIT(1) | BIT(0)) << 6);
-	DRM_DEBUG_KMS("Analog (VGA) Horizontal Sync Polarity: %s\n",
-			(sync_polarity & BIT(0)) ? "-" : "+");
-	DRM_DEBUG_KMS("Analog (VGA) Vertical Sync Polarity: %s\n",
-			(sync_polarity & BIT(1)) ? "-" : "+");
 }
 
 /*
@@ -501,8 +431,6 @@ static inline void via_dac_set_display_source(void __iomem *regs,
 	 *             1: Secondary Display Stream (IGA2) */
 	svga_wseq_mask(regs, 0x16,
 			display_source << 6, BIT(6));
-	DRM_DEBUG_KMS("Analog (VGA) Display Source: IGA%d\n",
-			(display_source & 0x01) + 1);
 }
 
 /*
@@ -517,9 +445,6 @@ static inline void via_lvds_set_primary_power_seq_type(void __iomem *regs,
 	 *             1: Software Control */
 	svga_wcrt_mask(regs, 0x91,
 			ctrl_type ? 0x00 : BIT(0), BIT(0));
-	DRM_DEBUG_KMS("FP Primary Power Sequence Control Type: "
-			"%s Control\n",
-			ctrl_type ? "Hardware" : "Software");
 }
 
 /*
@@ -534,8 +459,6 @@ static inline void via_lvds_set_primary_soft_back_light(void __iomem *regs,
 	 *             1: On */
 	svga_wcrt_mask(regs, 0x91,
 			soft_on ? BIT(1) : 0x00, BIT(1));
-	DRM_DEBUG_KMS("FP Primary Software Controlled Back Light: "
-			"%s\n", soft_on ? "On" : "Off");
 }
 
 /*
@@ -550,8 +473,6 @@ static inline void via_lvds_set_primary_soft_vee(void __iomem *regs,
 	 *             1: On */
 	svga_wcrt_mask(regs, 0x91,
 			soft_on ? BIT(2) : 0x00, BIT(2));
-	DRM_DEBUG_KMS("FP Primary Software Controlled VEE: %s\n",
-			soft_on ? "On" : "Off");
 }
 
 /*
@@ -566,8 +487,6 @@ static inline void via_lvds_set_primary_soft_data(void __iomem *regs,
 	 *             1: On */
 	svga_wcrt_mask(regs, 0x91,
 			soft_on ? BIT(3) : 0x00, BIT(3));
-	DRM_DEBUG_KMS("FP Primary Software Controlled Data: %s\n",
-			soft_on ? "On" : "Off");
 }
 
 /*
@@ -582,8 +501,6 @@ static inline void via_lvds_set_primary_soft_vdd(void __iomem *regs,
 	 *             1: On */
 	svga_wcrt_mask(regs, 0x91,
 			soft_on ? BIT(4) : 0x00, BIT(4));
-	DRM_DEBUG_KMS("FP Primary Software Controlled VDD: %s\n",
-			soft_on ? "On" : "Off");
 }
 
 /*
@@ -598,8 +515,6 @@ static inline void via_lvds_set_primary_direct_back_light_ctrl(
 	 *             1: Off */
 	svga_wcrt_mask(regs, 0x91,
 			direct_on ? 0x00 : BIT(6), BIT(6));
-	DRM_DEBUG_KMS("FP Primary Direct Back Light Control: %s\n",
-			direct_on ? "On" : "Off");
 }
 
 /*
@@ -614,8 +529,6 @@ static inline void via_lvds_set_primary_direct_display_period(
 	 *             1: Off */
 	svga_wcrt_mask(regs, 0x91,
 			direct_on ? 0x00 : BIT(7), BIT(7));
-	DRM_DEBUG_KMS("FP Primary Direct Display Period Control: %s\n",
-			direct_on ? "On" : "Off");
 }
 
 /*
@@ -630,8 +543,6 @@ static inline void via_lvds_set_primary_hard_power(void __iomem *regs,
 	 *             1: Hardware Controlled Power On */
 	svga_wcrt_mask(regs, 0x6A,
 			power_state ? BIT(3) : 0x00, BIT(3));
-	DRM_DEBUG_KMS("FP Primary Hardware Controlled Power "
-			"Sequence: %s\n", power_state ? "On" : "Off");
 }
 
 /*
@@ -646,9 +557,6 @@ static inline void via_lvds_set_secondary_power_seq_type(void __iomem *regs,
 	 *             1: Software Control */
 	svga_wcrt_mask(regs, 0xD3,
 			ctrl_type ? 0x00 : BIT(0), BIT(0));
-	DRM_DEBUG_KMS("FP Secondary Power Sequence Control Type: "
-			"%s Control\n",
-			ctrl_type ? "Hardware" : "Software");
 }
 
 /*
@@ -663,8 +571,6 @@ static inline void via_lvds_set_secondary_soft_back_light(void __iomem *regs,
 	 *             1: On */
 	svga_wcrt_mask(regs, 0xD3,
 			soft_on ? BIT(1) : 0x00, BIT(1));
-	DRM_DEBUG_KMS("FP Secondary Software Controlled Back Light: "
-			"%s\n", soft_on ? "On" : "Off");
 }
 
 /*
@@ -679,8 +585,6 @@ static inline void via_lvds_set_secondary_soft_vee(void __iomem *regs,
 	 *             1: On */
 	svga_wcrt_mask(regs, 0xD3,
 			soft_on ? BIT(2) : 0x00, BIT(2));
-	DRM_DEBUG_KMS("FP Secondary Software Controlled VEE: %s\n",
-			soft_on ? "On" : "Off");
 }
 
 /*
@@ -695,8 +599,6 @@ static inline void via_lvds_set_secondary_soft_data(void __iomem *regs,
 	 *             1: On */
 	svga_wcrt_mask(regs, 0xD3,
 			soft_on ? BIT(3) : 0x00, BIT(3));
-	DRM_DEBUG_KMS("FP Secondary Software Controlled Data: %s\n",
-			soft_on ? "On" : "Off");
 }
 
 /*
@@ -711,8 +613,6 @@ static inline void via_lvds_set_secondary_soft_vdd(void __iomem *regs,
 	 *             1: On */
 	svga_wcrt_mask(regs, 0xD3,
 			soft_on ? BIT(4) : 0x00, BIT(4));
-	DRM_DEBUG_KMS("FP Secondary Software Controlled VDD: %s\n",
-			soft_on ? "On" : "Off");
 }
 
 /*
@@ -727,8 +627,6 @@ static inline void via_lvds_set_secondary_direct_back_light_ctrl(
 	 *             1: Off */
 	svga_wcrt_mask(regs, 0xD3,
 			direct_on ? 0x00 : BIT(6), BIT(6));
-	DRM_DEBUG_KMS("FP Secondary Direct Back Light "
-			"Control: %s\n", direct_on ? "On" : "Off");
 }
 
 /*
@@ -743,8 +641,6 @@ static inline void via_lvds_set_secondary_direct_display_period(
 	 *             1: Off */
 	svga_wcrt_mask(regs, 0xD3,
 			direct_on ? 0x00 : BIT(7), BIT(7));
-	DRM_DEBUG_KMS("FP Secondary Direct Display Period "
-			"Control: %s\n", direct_on ? "On" : "Off");
 }
 
 /*
@@ -758,8 +654,6 @@ static inline void via_lvds_set_secondary_hard_power(void __iomem *regs,
 	 *             1: On */
 	svga_wcrt_mask(regs, 0xD4,
 			power_state ? BIT(1) : 0x00, BIT(1));
-	DRM_DEBUG_KMS("FP Secondary Hardware Controlled Power "
-			"Sequence: %s\n", power_state ? "On" : "Off");
 }
 
 /*
@@ -775,14 +669,6 @@ via_fpdp_low_set_io_pad_state(void __iomem *regs, u8 io_pad_state)
 	 *                   Power Management Status (PMS) */
 	svga_wseq_mask(regs, 0x2A,
 			io_pad_state, BIT(1) | BIT(0));
-	DRM_DEBUG_KMS("FPDP Low I/O Pad State: %s\n",
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x03) ?
-				"On" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x02) ?
-				"Conditional" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x01) ?
-				"Off" :
-				"Off");
 }
 
 /*
@@ -794,9 +680,6 @@ via_fpdp_low_set_adjustment(void __iomem *regs, u8 adjustment)
 	/* 3X5.99[3:0] - FPDP Low Adjustment */
 	svga_wcrt_mask(regs, 0x99,
 			adjustment, BIT(3) | BIT(2) | BIT(1) | BIT(0));
-	DRM_DEBUG_KMS("FPDP Low Adjustment: %lu\n",
-			(adjustment & (BIT(3) | BIT(2) |
-					BIT(1) | BIT(0))));
 }
 
 /*
@@ -810,8 +693,6 @@ via_fpdp_low_set_display_source(void __iomem *regs, u8 display_source)
 	 *             1: Secondary Display */
 	svga_wcrt_mask(regs, 0x99,
 			display_source << 4, BIT(4));
-	DRM_DEBUG_KMS("FPDP Low Display Source: IGA%d\n",
-			(display_source & 0x01) + 1);
 }
 
 /*
@@ -827,14 +708,6 @@ via_fpdp_high_set_io_pad_state(void __iomem *regs, u8 io_pad_state)
 	 *                   Power Management Status (PMS) */
 	svga_wseq_mask(regs, 0x2A,
 			io_pad_state << 2, BIT(3) | BIT(2));
-	DRM_DEBUG_KMS("FPDP High I/O Pad State: %s\n",
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x03) ?
-				"On" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x02) ?
-				"Conditional" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x01) ?
-				"Off" :
-				"Off");
 }
 
 /*
@@ -846,9 +719,6 @@ via_fpdp_high_set_adjustment(void __iomem *regs, u8 adjustment)
 	/* 3X5.97[3:0] - FPDP High Adjustment */
 	svga_wcrt_mask(regs, 0x97,
 			adjustment, BIT(3) | BIT(2) | BIT(1) | BIT(0));
-	DRM_DEBUG_KMS("FPDP High Adjustment: %lu\n",
-			(adjustment & (BIT(3) | BIT(2) |
-					BIT(1) | BIT(0))));
 }
 
 /*
@@ -862,8 +732,6 @@ via_fpdp_high_set_display_source(void __iomem *regs, u8 display_source)
 	 *             1: Secondary Display */
 	svga_wcrt_mask(regs, 0x97,
 			display_source << 4, BIT(4));
-	DRM_DEBUG_KMS("FPDP High Display Source: IGA%d\n",
-			(display_source & 0x01) + 1);
 }
 
 /*
@@ -877,8 +745,6 @@ via_lvds1_set_power(void __iomem *regs, bool power_state)
 	 *             1: Power off */
 	svga_wcrt_mask(regs, 0xD2,
 			power_state ? 0x00 : BIT(7), BIT(7));
-	DRM_DEBUG_KMS("LVDS1 Power State: %s\n",
-			power_state ? "On" : "Off");
 }
 
 /*
@@ -892,8 +758,6 @@ via_lvds1_set_power_seq(void __iomem *regs, bool softCtrl)
 	 *             0: Hardware Control
 	 *             1: Software Control */
 	svga_wcrt_mask(regs, 0x91, softCtrl ? BIT(0) : 0, BIT(0));
-	DRM_DEBUG_KMS("LVDS1 Power Sequence: %s Control\n",
-			softCtrl ? "Software" : "Hardware");
 }
 
 /*
@@ -908,8 +772,6 @@ via_lvds1_set_soft_data(void __iomem *regs, bool softOn)
 	 *             0: Off
 	 *             1: On */
 	svga_wcrt_mask(regs, 0x91, softOn ? BIT(3) : 0, BIT(3));
-	DRM_DEBUG_KMS("LVDS1 Software Controlled Data Path: %s\n",
-			softOn ? "On" : "Off");
 }
 
 /*
@@ -923,8 +785,6 @@ via_lvds1_set_soft_vdd(void __iomem *regs, bool softOn)
 	 *             0: Off
 	 *             1: On */
 	svga_wcrt_mask(regs, 0x91, softOn ? BIT(4) : 0, BIT(4));
-	DRM_DEBUG_KMS("LVDS1 Software Controlled Vdd: %s\n",
-			softOn ? "On" : "Off");
 }
 
 /*
@@ -940,8 +800,6 @@ via_lvds1_set_soft_display_period(void __iomem *regs, bool softOn)
 	 *             0: On
 	 *             1: Off */
 	svga_wcrt_mask(regs, 0x91, softOn ? 0 : BIT(7), BIT(7));
-	DRM_DEBUG_KMS("LVDS1 Software Controlled Display Period: %s\n",
-			softOn ? "On" : "Off");
 }
 
 /*
@@ -957,14 +815,6 @@ via_lvds1_set_io_pad_setting(void __iomem *regs, u8 io_pad_state)
 	 *                   Power Management Status (PMS) */
 	svga_wseq_mask(regs, 0x2A,
 			io_pad_state, BIT(1) | BIT(0));
-	DRM_DEBUG_KMS("LVDS1 I/O Pad State: %s\n",
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x03) ?
-				"On" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x02) ?
-				"Conditional" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x01) ?
-				"Off" :
-				"Off");
 }
 
 /*
@@ -978,8 +828,6 @@ via_lvds1_set_format(void __iomem *regs, u8 format)
 	 *             1: OPENLDI Mode */
 	svga_wcrt_mask(regs, 0xd2,
 			format << 1, BIT(1));
-	DRM_DEBUG_KMS("LVDS1 Format: %s\n",
-			(format & BIT(0)) ? "OPENLDI" : "SPWG");
 }
 
 /*
@@ -993,9 +841,6 @@ via_lvds1_set_output_format(void __iomem *regs, u8 output_format)
 	 *             1: Sequential */
 	svga_wcrt_mask(regs, 0x88,
 			output_format << 6, BIT(6));
-	DRM_DEBUG_KMS("LVDS1 Output Format: %s\n",
-			(output_format & BIT(0)) ?
-			"Sequential" : "Rotation");
 }
 
 /*
@@ -1010,9 +855,6 @@ via_lvds1_set_dithering(void __iomem *regs, bool dithering)
 	 *             1: 18 bits (dithering on) */
 	svga_wcrt_mask(regs, 0x88,
 			dithering ? BIT(0) : 0x00, BIT(0));
-	DRM_DEBUG_KMS("LVDS1 Color Dithering: %s\n",
-			dithering ?
-			"On (18 bit color)" : "Off (24 bit color)");
 }
 
 /*
@@ -1026,8 +868,6 @@ via_lvds1_set_display_source(void __iomem *regs, u8 display_source)
 	 *             1: Secondary Display */
 	svga_wcrt_mask(regs, 0x99,
 			display_source << 4, BIT(4));
-	DRM_DEBUG_KMS("LVDS1 Display Source: IGA%d\n",
-			(display_source & 0x01) + 1);
 }
 
 /*
@@ -1041,8 +881,6 @@ via_lvds2_set_power(void __iomem *regs, bool power_state)
 	 *             1: Power off */
 	svga_wcrt_mask(regs, 0xD2,
 			power_state ? 0x00 : BIT(6), BIT(6));
-	DRM_DEBUG_KMS("LVDS2 Power State: %s\n",
-			power_state ? "On" : "Off");
 }
 
 /*
@@ -1058,14 +896,6 @@ via_lvds2_set_io_pad_setting(void __iomem *regs, u8 io_pad_state)
 	 *                   Power Management Status (PMS) */
 	svga_wseq_mask(regs, 0x2A,
 			io_pad_state << 2, BIT(3) | BIT(2));
-	DRM_DEBUG_KMS("LVDS2 I/O Pad State: %s\n",
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x03) ?
-				"On" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x02) ?
-				"Conditional" :
-			((io_pad_state & (BIT(1) | BIT(0))) == 0x01) ?
-				"Off" :
-				"Off");
 }
 
 /*
@@ -1078,8 +908,6 @@ via_lvds2_set_format(void __iomem *regs, u8 format)
 	 *             0: SPWG Mode
 	 *             1: OPENLDI Mode */
 	svga_wcrt_mask(regs, 0xd2, format, BIT(0));
-	DRM_DEBUG_KMS("LVDS2 Format: %s\n",
-			(format & BIT(0)) ? "OPENLDI" : "SPWG");
 }
 
 /*
@@ -1092,9 +920,6 @@ via_lvds2_set_output_format(void __iomem *regs, u8 output_format)
 	 *             0: Rotation
 	 *             1: Sequential */
 	svga_wcrt_mask(regs, 0xd4, output_format << 7, BIT(7));
-	DRM_DEBUG_KMS("LVDS2 Output Format: %s\n",
-			(output_format & BIT(0)) ?
-			"Sequential" : "Rotation");
 }
 
 /*
@@ -1109,9 +934,6 @@ via_lvds2_set_dithering(void __iomem *regs, bool dithering)
 	 *             1: 18 bits (dithering on) */
 	svga_wcrt_mask(regs, 0xd4,
 			dithering ? BIT(6) : 0x00, BIT(6));
-	DRM_DEBUG_KMS("LVDS2 Color Dithering: %s\n",
-			dithering ?
-			"On (18 bit color)" : "Off (24 bit color)");
 }
 
 /*
@@ -1125,8 +947,6 @@ via_lvds2_set_display_source(void __iomem *regs, u8 display_source)
 	 *             1: Secondary Display */
 	svga_wcrt_mask(regs, 0x97,
 			display_source << 4, BIT(4));
-	DRM_DEBUG_KMS("LVDS2 Display Source: IGA%d\n",
-			(display_source & 0x01) + 1);
 }
 
 /*
@@ -1140,8 +960,6 @@ via_tmds_set_power(void __iomem *regs, bool powerState)
 	 *             1: TMDS power down */
 	svga_wcrt_mask(regs, 0xD2,
 			powerState ? 0x00 : BIT(3), BIT(3));
-	DRM_DEBUG_KMS("TMDS (DVI) Power State: %s\n",
-			powerState ? "On" : "Off");
 }
 
 /*
@@ -1159,10 +977,6 @@ via_tmds_set_sync_polarity(void __iomem *regs, u8 syncPolarity)
 	 *              1: Negative */
 	svga_wcrt_mask(regs, 0x97,
 			syncPolarity << 5, BIT(6) | BIT(5));
-	DRM_DEBUG_KMS("TMDS (DVI) Horizontal Sync Polarity: %s\n",
-			(syncPolarity & BIT(0)) ? "-" : "+");
-	DRM_DEBUG_KMS("TMDS (DVI) Vertical Sync Polarity: %s\n",
-			(syncPolarity & BIT(1)) ? "-" : "+");
 }
 
 /*
@@ -1178,8 +992,6 @@ via_tmds_set_display_source(void __iomem *regs, u8 displaySource)
 	 *             1: Secondary Display */
 	svga_wcrt_mask(regs, 0x99,
 			displaySource << 4, BIT(4));
-	DRM_DEBUG_KMS("TMDS (DVI) Display Source: IGA%d\n",
-			(displaySource & 0x01) + 1);
 }
 
 


More information about the openchrome-devel mailing list