[openchrome-devel] drm-openchrome: Branch 'drm-next-5.19' - 25 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Sat Jun 4 01:22:24 UTC 2022
drivers/gpu/drm/openchrome/Makefile | 38 +-
drivers/gpu/drm/openchrome/via_crtc.c | 260 +++++++---------
drivers/gpu/drm/openchrome/via_crtc_hw.c | 2
drivers/gpu/drm/openchrome/via_crtc_hw.h | 97 ++----
drivers/gpu/drm/openchrome/via_cursor.c | 94 ++---
drivers/gpu/drm/openchrome/via_dac.c | 171 ++++------
drivers/gpu/drm/openchrome/via_display.c | 44 +-
drivers/gpu/drm/openchrome/via_drv.c | 127 +++-----
drivers/gpu/drm/openchrome/via_drv.h | 178 +++++------
drivers/gpu/drm/openchrome/via_encoder.c | 25 -
drivers/gpu/drm/openchrome/via_hdmi.c | 115 ++-----
drivers/gpu/drm/openchrome/via_i2c.c | 26 -
drivers/gpu/drm/openchrome/via_init.c | 431 +++++++++++----------------
drivers/gpu/drm/openchrome/via_ioctl.c | 39 +-
drivers/gpu/drm/openchrome/via_lvds.c | 488 ++++++++++++++-----------------
drivers/gpu/drm/openchrome/via_object.c | 87 ++---
drivers/gpu/drm/openchrome/via_pll.c | 35 +-
drivers/gpu/drm/openchrome/via_pm.c | 80 ++---
drivers/gpu/drm/openchrome/via_regs.h | 2
drivers/gpu/drm/openchrome/via_sii164.c | 152 ++++-----
drivers/gpu/drm/openchrome/via_tmds.c | 254 +++++++---------
drivers/gpu/drm/openchrome/via_ttm.c | 69 +---
drivers/gpu/drm/openchrome/via_vt1632.c | 152 ++++-----
23 files changed, 1333 insertions(+), 1633 deletions(-)
New commits:
commit 70dfa2a4b3f9d2fcad7dc0abef40a843909774dc
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 20:19:42 2022 -0500
drm/openchrome: Version bumped to 3.4.20
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/via_drv.h b/drivers/gpu/drm/openchrome/via_drv.h
index ecccee06e6e4..47877804f843 100644
--- a/drivers/gpu/drm/openchrome/via_drv.h
+++ b/drivers/gpu/drm/openchrome/via_drv.h
@@ -54,10 +54,10 @@
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 4
-#define DRIVER_PATCHLEVEL 19
+#define DRIVER_PATCHLEVEL 20
#define DRIVER_NAME "openchrome"
#define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20220519"
+#define DRIVER_DATE "20220603"
#define DRIVER_AUTHOR "OpenChrome Project"
commit 8e4af9740fa385606859bd950fa61abdd44b9b31
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:17:10 2022 -0500
drm/openchrome: Convert C source files openchrome_*.c to via_*.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/Makefile b/drivers/gpu/drm/openchrome/Makefile
index f9b1f28d9182..cf13bfcfe020 100644
--- a/drivers/gpu/drm/openchrome/Makefile
+++ b/drivers/gpu/drm/openchrome/Makefile
@@ -3,24 +3,24 @@
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
ccflags-y := -Iinclude/drm
-openchrome-y := openchrome_crtc.o \
- openchrome_crtc_hw.o \
- openchrome_cursor.o \
- openchrome_dac.o \
- openchrome_display.o \
- openchrome_drv.o \
- openchrome_encoder.o \
- openchrome_hdmi.o \
- openchrome_i2c.o \
- openchrome_init.o \
- openchrome_ioctl.o \
- openchrome_lvds.o \
- openchrome_object.o \
- openchrome_pll.o \
- openchrome_pm.o \
- openchrome_sii164.o \
- openchrome_tmds.o \
- openchrome_ttm.o \
- openchrome_vt1632.o
+openchrome-y := via_crtc.o \
+ via_crtc_hw.o \
+ via_cursor.o \
+ via_dac.o \
+ via_display.o \
+ via_drv.o \
+ via_encoder.o \
+ via_hdmi.o \
+ via_i2c.o \
+ via_init.o \
+ via_ioctl.o \
+ via_lvds.o \
+ via_object.o \
+ via_pll.o \
+ via_pm.o \
+ via_sii164.o \
+ via_tmds.o \
+ via_ttm.o \
+ via_vt1632.o
obj-$(CONFIG_DRM_OPENCHROME) += openchrome.o
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/via_crtc.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_crtc.c
rename to drivers/gpu/drm/openchrome/via_crtc.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.c b/drivers/gpu/drm/openchrome/via_crtc_hw.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_crtc_hw.c
rename to drivers/gpu/drm/openchrome/via_crtc_hw.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/via_cursor.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_cursor.c
rename to drivers/gpu/drm/openchrome/via_cursor.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_dac.c b/drivers/gpu/drm/openchrome/via_dac.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_dac.c
rename to drivers/gpu/drm/openchrome/via_dac.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/via_display.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_display.c
rename to drivers/gpu/drm/openchrome/via_display.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/via_drv.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_drv.c
rename to drivers/gpu/drm/openchrome/via_drv.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_encoder.c b/drivers/gpu/drm/openchrome/via_encoder.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_encoder.c
rename to drivers/gpu/drm/openchrome/via_encoder.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/via_hdmi.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_hdmi.c
rename to drivers/gpu/drm/openchrome/via_hdmi.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_i2c.c b/drivers/gpu/drm/openchrome/via_i2c.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_i2c.c
rename to drivers/gpu/drm/openchrome/via_i2c.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/via_init.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_init.c
rename to drivers/gpu/drm/openchrome/via_init.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioctl.c b/drivers/gpu/drm/openchrome/via_ioctl.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_ioctl.c
rename to drivers/gpu/drm/openchrome/via_ioctl.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_lvds.c b/drivers/gpu/drm/openchrome/via_lvds.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_lvds.c
rename to drivers/gpu/drm/openchrome/via_lvds.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c b/drivers/gpu/drm/openchrome/via_object.c
similarity index 99%
rename from drivers/gpu/drm/openchrome/openchrome_object.c
rename to drivers/gpu/drm/openchrome/via_object.c
index 18a760efe7a9..a8c6a569043b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/via_object.c
@@ -28,7 +28,7 @@
* Kevin Brace <kevinbrace at gmx.com>
*/
/*
- * openchrome_object.c
+ * via_object.c
*
* Manages Buffer Objects (BO) via TTM.
* Part of the TTM memory allocator.
diff --git a/drivers/gpu/drm/openchrome/openchrome_pll.c b/drivers/gpu/drm/openchrome/via_pll.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_pll.c
rename to drivers/gpu/drm/openchrome/via_pll.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_pm.c b/drivers/gpu/drm/openchrome/via_pm.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_pm.c
rename to drivers/gpu/drm/openchrome/via_pm.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/via_sii164.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_sii164.c
rename to drivers/gpu/drm/openchrome/via_sii164.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/via_tmds.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_tmds.c
rename to drivers/gpu/drm/openchrome/via_tmds.c
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/via_ttm.c
similarity index 99%
rename from drivers/gpu/drm/openchrome/openchrome_ttm.c
rename to drivers/gpu/drm/openchrome/via_ttm.c
index e2906498ec5b..721f3608c505 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/via_ttm.c
@@ -28,7 +28,7 @@
* Kevin Brace <kevinbrace at gmx.com>
*/
/*
- * openchrome_ttm.c
+ * via_ttm.c
*
* TTM code as part of the TTM memory allocator.
* Currently a basic implementation with no DMA support.
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/via_vt1632.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_vt1632.c
rename to drivers/gpu/drm/openchrome/via_vt1632.c
commit 75fafb52d42a9a3b55720ad3f7f36d34967ba8ba
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:17:09 2022 -0500
drm/openchrome: Convert header files from openchrome_*.h to via_*.h
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 724c069d864a..a4a1854371b6 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -47,8 +47,8 @@
#include <drm/ttm/ttm_bo_api.h>
-#include "openchrome_drv.h"
-#include "openchrome_disp_reg.h"
+#include "via_drv.h"
+#include "via_disp_reg.h"
static struct vga_regset vpit_table[] = {
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.c b/drivers/gpu/drm/openchrome/openchrome_crtc_hw.c
index a7b04e4c69cd..ab6c458a8659 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc_hw.c
@@ -24,7 +24,7 @@
#include <video/vga.h>
-#include "openchrome_crtc_hw.h"
+#include "via_crtc_hw.h"
/*
* load_register_table enables the ability to set entire
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index eac05321b6bf..0d1de28d98ad 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -48,7 +48,7 @@
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
static void via_hide_cursor(struct drm_crtc *crtc)
diff --git a/drivers/gpu/drm/openchrome/openchrome_dac.c b/drivers/gpu/drm/openchrome/openchrome_dac.c
index d53de52017e6..67a5c0516387 100644
--- a/drivers/gpu/drm/openchrome/openchrome_dac.c
+++ b/drivers/gpu/drm/openchrome/openchrome_dac.c
@@ -29,8 +29,8 @@
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_probe_helper.h>
-#include "openchrome_crtc_hw.h"
-#include "openchrome_drv.h"
+#include "via_crtc_hw.h"
+#include "via_drv.h"
/*
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 7652292dcc53..063384ebe234 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -28,7 +28,7 @@
#include <drm/drm_crtc_helper.h>
#include <drm/drm_probe_helper.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
void via_encoder_cleanup(struct drm_encoder *encoder)
{
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 3925dbc0da8e..39197317c713 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -40,7 +40,7 @@
#include <drm/ttm/ttm_bo_api.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
extern const struct drm_ioctl_desc via_driver_ioctls[];
diff --git a/drivers/gpu/drm/openchrome/openchrome_encoder.c b/drivers/gpu/drm/openchrome/openchrome_encoder.c
index f4c9497401e4..c7104f275bd5 100644
--- a/drivers/gpu/drm/openchrome/openchrome_encoder.c
+++ b/drivers/gpu/drm/openchrome/openchrome_encoder.c
@@ -30,7 +30,7 @@
#include <linux/pci.h>
#include <linux/pci_ids.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
void via_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index e077936bf4df..37b7fb02ab0b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -31,7 +31,7 @@
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
#define HDMI_AUDIO_ENABLED BIT(0)
diff --git a/drivers/gpu/drm/openchrome/openchrome_i2c.c b/drivers/gpu/drm/openchrome/openchrome_i2c.c
index 319aaaa61f93..6c8012c5be00 100644
--- a/drivers/gpu/drm/openchrome/openchrome_i2c.c
+++ b/drivers/gpu/drm/openchrome/openchrome_i2c.c
@@ -18,7 +18,7 @@
#include <linux/delay.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
enum viafb_i2c_adap;
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 2ef70788f414..52ad87c8e418 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -31,7 +31,7 @@
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_mode_config.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
static int cle266_mem_type(struct via_drm_priv *dev_priv,
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioctl.c b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
index 9dec4c77e36b..37f9a675c575 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioctl.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
@@ -35,7 +35,7 @@
#include <uapi/drm/openchrome_drm.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
static int via_gem_create_ioctl(struct drm_device *dev,
diff --git a/drivers/gpu/drm/openchrome/openchrome_lvds.c b/drivers/gpu/drm/openchrome/openchrome_lvds.c
index 9a728c22f0f3..e1f523ccf184 100644
--- a/drivers/gpu/drm/openchrome/openchrome_lvds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_lvds.c
@@ -32,7 +32,7 @@
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_probe_helper.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
#define TD0 200
#define TD1 25
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c b/drivers/gpu/drm/openchrome/openchrome_object.c
index ac18ebf77fdc..18a760efe7a9 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -43,7 +43,7 @@
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_range_manager.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
static void via_gem_free(struct drm_gem_object *obj)
diff --git a/drivers/gpu/drm/openchrome/openchrome_pll.c b/drivers/gpu/drm/openchrome/openchrome_pll.c
index 3faef24abee0..78aa63a39b48 100644
--- a/drivers/gpu/drm/openchrome/openchrome_pll.c
+++ b/drivers/gpu/drm/openchrome/openchrome_pll.c
@@ -23,7 +23,7 @@
#include <linux/pci.h>
#include <linux/pci_ids.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
#define CSR_VCO_UP 600000000
diff --git a/drivers/gpu/drm/openchrome/openchrome_pm.c b/drivers/gpu/drm/openchrome/openchrome_pm.c
index 6adc0bdbfce9..bc6d30a9100a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_pm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_pm.c
@@ -32,7 +32,7 @@
#include <linux/console.h>
#include <linux/pci.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
int via_dev_pm_ops_suspend(struct device *dev)
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/openchrome_sii164.c
index 4a90e64d31d4..30ed720b8854 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -30,7 +30,7 @@
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_probe_helper.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
#define SII164_VEN BIT(5)
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/openchrome_tmds.c
index 5658cede5167..8eff1a566a76 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -31,7 +31,7 @@
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_probe_helper.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
static void via_tmds_power(struct via_drm_priv *dev_priv,
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index 6327398d67d1..e2906498ec5b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -40,7 +40,7 @@
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
static void via_bo_move_notify(struct ttm_buffer_object *bo, bool evict,
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index 9b92ef9f708a..9cd640e2bc65 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -30,7 +30,7 @@
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_probe_helper.h>
-#include "openchrome_drv.h"
+#include "via_drv.h"
#define VIA_VT1632_VEN BIT(5)
diff --git a/drivers/gpu/drm/openchrome/openchrome_3d_reg.h b/drivers/gpu/drm/openchrome/via_3d_reg.h
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_3d_reg.h
rename to drivers/gpu/drm/openchrome/via_3d_reg.h
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h b/drivers/gpu/drm/openchrome/via_crtc_hw.h
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
rename to drivers/gpu/drm/openchrome/via_crtc_hw.h
diff --git a/drivers/gpu/drm/openchrome/openchrome_disp_reg.h b/drivers/gpu/drm/openchrome/via_disp_reg.h
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_disp_reg.h
rename to drivers/gpu/drm/openchrome/via_disp_reg.h
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/via_drv.h
similarity index 99%
rename from drivers/gpu/drm/openchrome/openchrome_drv.h
rename to drivers/gpu/drm/openchrome/via_drv.h
index 6bb50c348508..ecccee06e6e4 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/via_drv.h
@@ -48,8 +48,8 @@
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_placement.h>
-#include "openchrome_crtc_hw.h"
-#include "openchrome_regs.h"
+#include "via_crtc_hw.h"
+#include "via_regs.h"
#define DRIVER_MAJOR 3
diff --git a/drivers/gpu/drm/openchrome/openchrome_regs.h b/drivers/gpu/drm/openchrome/via_regs.h
similarity index 99%
rename from drivers/gpu/drm/openchrome/openchrome_regs.h
rename to drivers/gpu/drm/openchrome/via_regs.h
index 608e1e997045..079540f7a1a5 100644
--- a/drivers/gpu/drm/openchrome/openchrome_regs.h
+++ b/drivers/gpu/drm/openchrome/via_regs.h
@@ -26,7 +26,7 @@
/*************************************************************************
*
- * File: openchrome_regs.h
+ * File: via_regs.h
* Content: The defines of VIA Technologies Chrome registers.
*
************************************************************************/
commit bd2327312c9aed38e3ab59a0c3629c382e84eb68
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:17:08 2022 -0500
drm/openchrome: Convert openchrome_*() to via_*()
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index f7c54d4a0f9c..724c069d864a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -178,7 +178,7 @@ static void via_iga2_set_color_depth(struct via_drm_priv *dev_priv,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static int openchrome_gamma_set(struct drm_crtc *crtc,
+static int via_gamma_set(struct drm_crtc *crtc,
u16 *r, u16 *g, u16 *b,
uint32_t size,
struct drm_modeset_acquire_ctx *ctx)
@@ -332,7 +332,7 @@ exit:
return ret;
}
-static void openchrome_crtc_destroy(struct drm_crtc *crtc)
+static void via_crtc_destroy(struct drm_crtc *crtc)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
@@ -342,9 +342,9 @@ static void openchrome_crtc_destroy(struct drm_crtc *crtc)
static const struct drm_crtc_funcs via_drm_crtc_funcs = {
.reset = drm_atomic_helper_crtc_reset,
- .gamma_set = openchrome_gamma_set,
+ .gamma_set = via_gamma_set,
.set_config = drm_atomic_helper_set_config,
- .destroy = openchrome_crtc_destroy,
+ .destroy = via_crtc_destroy,
.page_flip = drm_atomic_helper_page_flip,
.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
@@ -1576,7 +1576,7 @@ void via_set_iga2_downscale_source_timing(struct drm_crtc *crtc,
drm_mode_destroy(crtc->dev, src_timing);
}
-void openchrome_mode_set_nofb(struct drm_crtc *crtc)
+void via_mode_set_nofb(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -1790,7 +1790,7 @@ exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+static void via_crtc_helper_atomic_enable(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{
struct drm_device *dev = crtc->dev;
@@ -1809,7 +1809,7 @@ static void openchrome_crtc_helper_atomic_enable(struct drm_crtc *crtc,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+static void via_crtc_helper_atomic_disable(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{
struct drm_device *dev = crtc->dev;
@@ -1829,12 +1829,12 @@ static void openchrome_crtc_helper_atomic_disable(struct drm_crtc *crtc,
}
static const struct drm_crtc_helper_funcs via_drm_crtc_helper_funcs = {
- .mode_set_nofb = openchrome_mode_set_nofb,
- .atomic_enable = openchrome_crtc_helper_atomic_enable,
- .atomic_disable = openchrome_crtc_helper_atomic_disable,
+ .mode_set_nofb = via_mode_set_nofb,
+ .atomic_enable = via_crtc_helper_atomic_enable,
+ .atomic_disable = via_crtc_helper_atomic_disable,
};
-static int openchrome_primary_atomic_check(struct drm_plane *plane,
+static int via_primary_atomic_check(struct drm_plane *plane,
struct drm_atomic_state *state)
{
struct drm_plane_state *new_plane_state =
@@ -1878,7 +1878,7 @@ exit:
return ret;
}
-static void openchrome_primary_atomic_disable(struct drm_plane *plane,
+static void via_primary_atomic_disable(struct drm_plane *plane,
struct drm_atomic_state *state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1887,7 +1887,7 @@ static void openchrome_primary_atomic_disable(struct drm_plane *plane,
return;
}
-void openchrome_primary_atomic_update(struct drm_plane *plane,
+void via_primary_atomic_update(struct drm_plane *plane,
struct drm_atomic_state *state)
{
struct drm_plane_state *new_state =
@@ -1960,7 +1960,7 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static int openchrome_primary_prepare_fb(struct drm_plane *plane,
+static int via_primary_prepare_fb(struct drm_plane *plane,
struct drm_plane_state *new_state)
{
struct drm_gem_object *gem;
@@ -1983,14 +1983,14 @@ static int openchrome_primary_prepare_fb(struct drm_plane *plane,
goto exit;
}
- ret = openchrome_bo_pin(bo, TTM_PL_VRAM);
+ ret = via_bo_pin(bo, TTM_PL_VRAM);
ttm_bo_unreserve(&bo->ttm_bo);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
}
-static void openchrome_primary_cleanup_fb(struct drm_plane *plane,
+static void via_primary_cleanup_fb(struct drm_plane *plane,
struct drm_plane_state *old_state)
{
struct drm_gem_object *gem;
@@ -2013,7 +2013,7 @@ static void openchrome_primary_cleanup_fb(struct drm_plane *plane,
goto exit;
}
- openchrome_bo_unpin(bo);
+ via_bo_unpin(bo);
ttm_bo_unreserve(&bo->ttm_bo);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -2021,11 +2021,11 @@ exit:
static const struct drm_plane_helper_funcs
via_primary_drm_plane_helper_funcs = {
- .prepare_fb = openchrome_primary_prepare_fb,
- .cleanup_fb = openchrome_primary_cleanup_fb,
- .atomic_check = openchrome_primary_atomic_check,
- .atomic_update = openchrome_primary_atomic_update,
- .atomic_disable = openchrome_primary_atomic_disable,
+ .prepare_fb = via_primary_prepare_fb,
+ .cleanup_fb = via_primary_cleanup_fb,
+ .atomic_check = via_primary_atomic_check,
+ .atomic_update = via_primary_atomic_update,
+ .atomic_disable = via_primary_atomic_disable,
};
static const struct drm_plane_funcs via_primary_drm_plane_funcs = {
@@ -2039,7 +2039,7 @@ static const struct drm_plane_funcs via_primary_drm_plane_funcs = {
drm_atomic_helper_plane_destroy_state,
};
-static void openchrome_crtc_param_init(struct via_drm_priv *dev_priv,
+static void via_crtc_param_init(struct via_drm_priv *dev_priv,
struct drm_crtc *crtc,
uint32_t index)
{
@@ -2199,7 +2199,7 @@ static void openchrome_crtc_param_init(struct via_drm_priv *dev_priv,
}
}
-static int openchrome_gamma_init(struct drm_crtc *crtc)
+static int via_gamma_init(struct drm_crtc *crtc)
{
u16 *gamma;
uint32_t i;
@@ -2233,7 +2233,7 @@ static const uint32_t via_primary_formats[] = {
DRM_FORMAT_RGB332,
};
-int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
+int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
{
struct drm_device *dev = &dev_priv->dev;
struct via_crtc *iga;
@@ -2304,8 +2304,8 @@ int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
iga->index = index;
- openchrome_crtc_param_init(dev_priv, &iga->base, index);
- ret = openchrome_gamma_init(&iga->base);
+ via_crtc_param_init(dev_priv, &iga->base, index);
+ ret = via_gamma_init(&iga->base);
if (ret) {
goto free_crtc;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index 68bbdc793aaa..eac05321b6bf 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -51,7 +51,7 @@
#include "openchrome_drv.h"
-static void openchrome_hide_cursor(struct drm_crtc *crtc)
+static void via_hide_cursor(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -83,7 +83,7 @@ static void openchrome_hide_cursor(struct drm_crtc *crtc)
}
}
-static void openchrome_show_cursor(struct drm_crtc *crtc)
+static void via_show_cursor(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -159,8 +159,8 @@ static void openchrome_show_cursor(struct drm_crtc *crtc)
}
}
-static void openchrome_cursor_address(struct drm_crtc *crtc,
- struct ttm_buffer_object *ttm_bo)
+static void via_cursor_address(struct drm_crtc *crtc,
+ struct ttm_buffer_object *ttm_bo)
{
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -197,9 +197,7 @@ static void openchrome_cursor_address(struct drm_crtc *crtc,
return;
}
-static void openchrome_set_hi_location(struct drm_crtc *crtc,
- int crtc_x,
- int crtc_y)
+static void via_set_hi_location(struct drm_crtc *crtc, int crtc_x, int crtc_y)
{
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -256,8 +254,8 @@ static void openchrome_set_hi_location(struct drm_crtc *crtc,
}
}
-static int openchrome_cursor_prepare_fb(struct drm_plane *plane,
- struct drm_plane_state *new_state)
+static int via_cursor_prepare_fb(struct drm_plane *plane,
+ struct drm_plane_state *new_state)
{
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
@@ -279,7 +277,7 @@ static int openchrome_cursor_prepare_fb(struct drm_plane *plane,
goto exit;
}
- ret = openchrome_bo_pin(bo, TTM_PL_VRAM);
+ ret = via_bo_pin(bo, TTM_PL_VRAM);
ttm_bo_unreserve(&bo->ttm_bo);
ret = ttm_bo_kmap(&bo->ttm_bo, 0,
bo->ttm_bo.resource->num_pages,
@@ -293,7 +291,7 @@ exit:
return ret;
}
-static void openchrome_cursor_cleanup_fb(struct drm_plane *plane,
+static void via_cursor_cleanup_fb(struct drm_plane *plane,
struct drm_plane_state *old_state)
{
struct drm_gem_object *gem;
@@ -317,14 +315,14 @@ static void openchrome_cursor_cleanup_fb(struct drm_plane *plane,
goto exit;
}
- openchrome_bo_unpin(bo);
+ via_bo_unpin(bo);
ttm_bo_unreserve(&bo->ttm_bo);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static int openchrome_cursor_atomic_check(struct drm_plane *plane,
+static int via_cursor_atomic_check(struct drm_plane *plane,
struct drm_atomic_state *state)
{
struct drm_plane_state *new_plane_state =
@@ -359,7 +357,7 @@ exit:
return ret;
}
-static void openchrome_cursor_atomic_update(struct drm_plane *plane,
+static void via_cursor_atomic_update(struct drm_plane *plane,
struct drm_atomic_state *state)
{
struct drm_plane_state *new_state =
@@ -375,18 +373,16 @@ static void openchrome_cursor_atomic_update(struct drm_plane *plane,
if (new_state->fb != old_state->fb) {
gem = new_state->fb->obj[0];
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
- openchrome_cursor_address(crtc, ttm_bo);
+ via_cursor_address(crtc, ttm_bo);
}
- openchrome_set_hi_location(crtc,
- new_state->crtc_x,
- new_state->crtc_y);
- openchrome_show_cursor(crtc);
+ via_set_hi_location(crtc, new_state->crtc_x, new_state->crtc_y);
+ via_show_cursor(crtc);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_cursor_atomic_disable(struct drm_plane *plane,
+void via_cursor_atomic_disable(struct drm_plane *plane,
struct drm_atomic_state *state)
{
struct drm_plane_state *new_state =
@@ -396,18 +392,18 @@ void openchrome_cursor_atomic_disable(struct drm_plane *plane,
DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (crtc) {
- openchrome_hide_cursor(crtc);
+ via_hide_cursor(crtc);
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
const struct drm_plane_helper_funcs via_cursor_drm_plane_helper_funcs = {
- .prepare_fb = openchrome_cursor_prepare_fb,
- .cleanup_fb = openchrome_cursor_cleanup_fb,
- .atomic_check = openchrome_cursor_atomic_check,
- .atomic_update = openchrome_cursor_atomic_update,
- .atomic_disable = openchrome_cursor_atomic_disable,
+ .prepare_fb = via_cursor_prepare_fb,
+ .cleanup_fb = via_cursor_cleanup_fb,
+ .atomic_check = via_cursor_atomic_check,
+ .atomic_update = via_cursor_atomic_update,
+ .atomic_disable = via_cursor_atomic_disable,
};
const struct drm_plane_funcs via_cursor_drm_plane_funcs = {
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index e64883c18a66..7652292dcc53 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -127,7 +127,7 @@ int via_modeset_init(struct drm_device *dev)
uint32_t i;
int ret = 0;
- openchrome_mode_config_init(dev_priv);
+ via_mode_config_init(dev_priv);
/* Initialize the number of display connectors. */
dev_priv->number_fp = 0;
@@ -144,13 +144,13 @@ int via_modeset_init(struct drm_device *dev)
}
for (i = 0; i < VIA_MAX_CRTC; i++) {
- ret = openchrome_crtc_init(dev_priv, i);
+ ret = via_crtc_init(dev_priv, i);
if (ret) {
goto exit;
}
}
- openchrome_ext_dvi_probe(dev);
+ via_ext_dvi_probe(dev);
via_tmds_probe(dev);
via_lvds_probe(dev);
@@ -158,7 +158,7 @@ int via_modeset_init(struct drm_device *dev)
via_dac_probe(dev);
- openchrome_ext_dvi_init(dev);
+ via_ext_dvi_init(dev);
via_tmds_init(dev);
via_dac_init(dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 939475003c5d..3925dbc0da8e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -57,7 +57,7 @@ MODULE_PARM_DESC(modeset, "Enable DRM device driver "
"1 = Enabled)");
module_param_named(modeset, via_modeset, int, 0400);
-static int openchrome_driver_open(struct drm_device *dev,
+static int via_driver_open(struct drm_device *dev,
struct drm_file *file_priv)
{
int ret = 0;
@@ -68,7 +68,7 @@ static int openchrome_driver_open(struct drm_device *dev,
return ret;
}
-static void openchrome_driver_postclose(struct drm_device *dev,
+static void via_driver_postclose(struct drm_device *dev,
struct drm_file *file_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -76,7 +76,7 @@ static void openchrome_driver_postclose(struct drm_device *dev,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_driver_lastclose(struct drm_device *dev)
+static void via_driver_lastclose(struct drm_device *dev)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -85,7 +85,7 @@ static void openchrome_driver_lastclose(struct drm_device *dev)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static int openchrome_driver_dumb_create(struct drm_file *file_priv,
+static int via_driver_dumb_create(struct drm_file *file_priv,
struct drm_device *dev,
struct drm_mode_create_dumb *args)
{
@@ -103,7 +103,7 @@ static int openchrome_driver_dumb_create(struct drm_file *file_priv,
pitch = args->width * ((args->bpp + 7) >> 3);
size = pitch * args->height;
- ret = openchrome_bo_create(dev,
+ ret = via_bo_create(dev,
&dev_priv->bdev,
size,
ttm_bo_type_device,
@@ -128,7 +128,7 @@ exit:
return ret;
}
-static int openchrome_driver_dumb_map_offset(struct drm_file *file_priv,
+static int via_driver_dumb_map_offset(struct drm_file *file_priv,
struct drm_device *dev,
uint32_t handle,
uint64_t *offset)
@@ -171,12 +171,12 @@ static struct drm_driver via_driver = {
DRIVER_GEM |
DRIVER_MODESET |
DRIVER_ATOMIC,
- .open = openchrome_driver_open,
- .postclose = openchrome_driver_postclose,
- .lastclose = openchrome_driver_lastclose,
+ .open = via_driver_open,
+ .postclose = via_driver_postclose,
+ .lastclose = via_driver_lastclose,
.gem_prime_mmap = drm_gem_prime_mmap,
- .dumb_create = openchrome_driver_dumb_create,
- .dumb_map_offset = openchrome_driver_dumb_map_offset,
+ .dumb_create = via_driver_dumb_create,
+ .dumb_map_offset = via_driver_dumb_map_offset,
.ioctls = via_driver_ioctls,
.fops = &via_driver_fops,
.name = DRIVER_NAME,
@@ -193,7 +193,7 @@ static struct pci_device_id via_pci_table[] = {
MODULE_DEVICE_TABLE(pci, via_pci_table);
-static int openchrome_pci_probe(struct pci_dev *pdev,
+static int via_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct drm_device *dev;
@@ -226,7 +226,7 @@ static int openchrome_pci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, dev);
- ret = openchrome_drm_init(dev);
+ ret = via_drm_init(dev);
if (ret) {
goto error_disable_pci;
}
@@ -245,32 +245,32 @@ exit:
return ret;
}
-static void openchrome_pci_remove(struct pci_dev *pdev)
+static void via_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- openchrome_drm_fini(dev);
+ via_drm_fini(dev);
drm_dev_unregister(dev);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static const struct dev_pm_ops via_dev_pm_ops = {
- .suspend = openchrome_dev_pm_ops_suspend,
- .resume = openchrome_dev_pm_ops_resume,
+ .suspend = via_dev_pm_ops_suspend,
+ .resume = via_dev_pm_ops_resume,
};
static struct pci_driver via_pci_driver = {
.name = DRIVER_NAME,
.id_table = via_pci_table,
- .probe = openchrome_pci_probe,
- .remove = openchrome_pci_remove,
+ .probe = via_pci_probe,
+ .remove = via_pci_remove,
.driver.pm = &via_dev_pm_ops,
};
-static int __init openchrome_init(void)
+static int __init via_init(void)
{
int ret = 0;
@@ -295,7 +295,7 @@ exit:
return ret;
}
-static void __exit openchrome_exit(void)
+static void __exit via_exit(void)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -308,8 +308,8 @@ exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-module_init(openchrome_init);
-module_exit(openchrome_exit);
+module_init(via_init);
+module_exit(via_exit);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 8e31013fb091..6bb50c348508 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -350,49 +350,42 @@ extern int via_driver_num_ioctls;
extern struct ttm_device_funcs via_bo_driver;
-int openchrome_vram_detect(struct via_drm_priv *dev_priv);
-int openchrome_vram_init(struct via_drm_priv *dev_priv);
-void openchrome_vram_fini(struct via_drm_priv *dev_priv);
-int openchrome_mmio_init(struct via_drm_priv *dev_priv);
-void openchrome_mmio_fini(struct via_drm_priv *dev_priv);
-void openchrome_graphics_unlock(struct via_drm_priv *dev_priv);
+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);
void chip_revision_info(struct via_drm_priv *dev_priv);
-int openchrome_device_init(struct via_drm_priv *dev_priv);
-void openchrome_device_fini(struct via_drm_priv *dev_priv);
-void openchrome_mode_config_init(struct via_drm_priv *dev_priv);
-int openchrome_drm_init(struct drm_device *dev);
-void openchrome_drm_fini(struct drm_device *dev);
-
-int openchrome_dev_pm_ops_suspend(struct device *dev);
-int openchrome_dev_pm_ops_resume(struct device *dev);
-
-void openchrome_ttm_domain_to_placement(struct via_bo *bo,
- uint32_t ttm_domain);
-void openchrome_ttm_bo_destroy(struct ttm_buffer_object *tbo);
-int openchrome_bo_pin(struct via_bo *bo, uint32_t ttm_domain);
-void openchrome_bo_unpin(struct via_bo *bo);
-int openchrome_bo_create(struct drm_device *dev,
- struct ttm_device *bdev,
- uint64_t size,
- enum ttm_bo_type type,
- uint32_t ttm_domain,
- bool kmap,
- struct via_bo **bo_ptr);
-void openchrome_bo_destroy(struct via_bo *bo, bool kmap);
-int openchrome_mm_init(struct via_drm_priv *dev_priv);
-void openchrome_mm_fini(struct via_drm_priv *dev_priv);
-
-void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
- uint32_t di_port,
- bool io_pad_on);
-void openchrome_transmitter_clock_drive_strength(
- 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_drm_init(struct drm_device *dev);
+void via_drm_fini(struct drm_device *dev);
+
+int via_dev_pm_ops_suspend(struct device *dev);
+int via_dev_pm_ops_resume(struct device *dev);
+
+void via_ttm_domain_to_placement(struct via_bo *bo, uint32_t ttm_domain);
+void via_ttm_bo_destroy(struct ttm_buffer_object *tbo);
+int via_bo_pin(struct via_bo *bo, uint32_t ttm_domain);
+void via_bo_unpin(struct via_bo *bo);
+int via_bo_create(struct drm_device *dev, struct ttm_device *bdev,
+ uint64_t size, enum ttm_bo_type type,
+ 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);
+
+void via_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
+ uint32_t di_port, bool io_pad_on);
+void via_transmitter_clock_drive_strength(struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength);
-void openchrome_transmitter_data_drive_strength(
- struct via_drm_priv *dev_priv,
+void via_transmitter_data_drive_strength(struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength);
-void openchrome_transmitter_display_source(struct via_drm_priv *dev_priv,
- u32 di_port, int index);
+void via_transmitter_display_source(struct via_drm_priv *dev_priv,
+ u32 di_port, int index);
extern const struct drm_plane_helper_funcs via_cursor_drm_plane_helper_funcs;
extern const struct drm_plane_funcs via_cursor_drm_plane_funcs;
@@ -422,7 +415,7 @@ void via_set_vclock(struct drm_crtc *crtc, u32 clk);
/* crtc */
void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
struct drm_display_mode *mode);
-int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index);
+int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index);
/* encoders */
void via_encoder_cleanup(struct drm_encoder *encoder);
@@ -433,17 +426,17 @@ int via_connector_mode_valid(struct drm_connector *connector,
void via_connector_destroy(struct drm_connector *connector);
void via_dac_probe(struct drm_device *dev);
-bool openchrome_vt1632_probe(struct i2c_adapter *i2c_bus);
-bool openchrome_sii164_probe(struct i2c_adapter *i2c_bus);
-void openchrome_ext_dvi_probe(struct drm_device *dev);
+bool via_vt1632_probe(struct i2c_adapter *i2c_bus);
+bool via_sii164_probe(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);
void via_hdmi_init(struct drm_device *dev, u32 di_port);
void via_dac_init(struct drm_device *dev);
-void openchrome_vt1632_init(struct drm_device *dev);
-void openchrome_sii164_init(struct drm_device *dev);
-void openchrome_ext_dvi_init(struct drm_device *dev);
+void via_vt1632_init(struct drm_device *dev);
+void via_sii164_init(struct drm_device *dev);
+void via_ext_dvi_init(struct drm_device *dev);
void via_tmds_init(struct drm_device *dev);
void via_lvds_init(struct drm_device *dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_encoder.c b/drivers/gpu/drm/openchrome/openchrome_encoder.c
index 6c05f0da00cb..f4c9497401e4 100644
--- a/drivers/gpu/drm/openchrome/openchrome_encoder.c
+++ b/drivers/gpu/drm/openchrome/openchrome_encoder.c
@@ -33,7 +33,7 @@
#include "openchrome_drv.h"
-void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
+void via_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
uint32_t di_port,
bool io_pad_on)
{
@@ -85,7 +85,7 @@ void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_transmitter_clock_drive_strength(
+void via_transmitter_clock_drive_strength(
struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength)
{
@@ -107,7 +107,7 @@ void openchrome_transmitter_clock_drive_strength(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_transmitter_data_drive_strength(
+void via_transmitter_data_drive_strength(
struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength)
{
@@ -129,7 +129,7 @@ void openchrome_transmitter_data_drive_strength(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_transmitter_display_source(struct via_drm_priv *dev_priv,
+void via_transmitter_display_source(struct via_drm_priv *dev_priv,
u32 di_port, int index)
{
u8 display_source = index & 0x01;
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 5991c6c72c0b..2ef70788f414 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -724,7 +724,7 @@ static int vx900_mem_type(struct via_drm_priv *dev_priv,
return ret;
}
-int openchrome_vram_detect(struct via_drm_priv *dev_priv)
+int via_vram_detect(struct via_drm_priv *dev_priv)
{
struct drm_device *dev = &dev_priv->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -951,7 +951,7 @@ out_err:
return ret;
}
-static void openchrome_flag_init(struct via_drm_priv *dev_priv)
+static void via_flag_init(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -961,7 +961,7 @@ static void openchrome_flag_init(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_quirks_init(struct via_drm_priv *dev_priv)
+static void via_quirks_init(struct via_drm_priv *dev_priv)
{
struct drm_device *dev = &dev_priv->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -1015,7 +1015,7 @@ static void openchrome_quirks_init(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_vram_init(struct via_drm_priv *dev_priv)
+int via_vram_init(struct via_drm_priv *dev_priv)
{
int ret = 0;
@@ -1029,7 +1029,7 @@ int openchrome_vram_init(struct via_drm_priv *dev_priv)
return ret;
}
-void openchrome_vram_fini(struct via_drm_priv *dev_priv)
+void via_vram_fini(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1043,7 +1043,7 @@ void openchrome_vram_fini(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_mmio_init(struct via_drm_priv *dev_priv)
+int via_mmio_init(struct via_drm_priv *dev_priv)
{
struct drm_device *dev = &dev_priv->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -1071,7 +1071,7 @@ exit:
return ret;
}
-void openchrome_mmio_fini(struct via_drm_priv *dev_priv)
+void via_mmio_fini(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1083,7 +1083,7 @@ void openchrome_mmio_fini(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_graphics_unlock(struct via_drm_priv *dev_priv)
+void via_graphics_unlock(struct via_drm_priv *dev_priv)
{
uint8_t temp;
@@ -1162,16 +1162,16 @@ void chip_revision_info(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_device_init(struct via_drm_priv *dev_priv)
+int via_device_init(struct via_drm_priv *dev_priv)
{
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- openchrome_flag_init(dev_priv);
- openchrome_quirks_init(dev_priv);
+ via_flag_init(dev_priv);
+ via_quirks_init(dev_priv);
- ret = openchrome_vram_detect(dev_priv);
+ ret = via_vram_detect(dev_priv);
if (ret) {
DRM_ERROR("Failed to detect video RAM.\n");
goto exit;
@@ -1180,30 +1180,30 @@ int openchrome_device_init(struct via_drm_priv *dev_priv)
/*
* Map VRAM.
*/
- ret = openchrome_vram_init(dev_priv);
+ ret = via_vram_init(dev_priv);
if (ret) {
DRM_ERROR("Failed to initialize video RAM.\n");
goto exit;
}
- ret = openchrome_mmio_init(dev_priv);
+ ret = via_mmio_init(dev_priv);
if (ret) {
DRM_ERROR("Failed to initialize MMIO.\n");
goto exit;
}
- openchrome_graphics_unlock(dev_priv);
+ via_graphics_unlock(dev_priv);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
}
-void openchrome_device_fini(struct via_drm_priv *dev_priv)
+void via_device_fini(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- openchrome_mmio_fini(dev_priv);
- openchrome_vram_fini(dev_priv);
+ via_mmio_fini(dev_priv);
+ via_vram_fini(dev_priv);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -1214,7 +1214,7 @@ static const struct drm_mode_config_funcs via_drm_mode_config_funcs = {
.atomic_commit = drm_atomic_helper_commit,
};
-void openchrome_mode_config_init(struct via_drm_priv *dev_priv)
+void via_mode_config_init(struct via_drm_priv *dev_priv)
{
struct drm_device *dev = &dev_priv->dev;
@@ -1240,7 +1240,7 @@ void openchrome_mode_config_init(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_drm_init(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;
@@ -1249,13 +1249,13 @@ int openchrome_drm_init(struct drm_device *dev)
dev_priv->vram_mtrr = -ENXIO;
- ret = openchrome_device_init(dev_priv);
+ ret = via_device_init(dev_priv);
if (ret) {
DRM_ERROR("Failed to initialize Chrome IGP.\n");
goto exit;
}
- ret = openchrome_mm_init(dev_priv);
+ ret = via_mm_init(dev_priv);
if (ret) {
DRM_ERROR("Failed to initialize TTM.\n");
goto exit;
@@ -1272,24 +1272,24 @@ int openchrome_drm_init(struct drm_device *dev)
goto exit;
error_modeset:
via_modeset_fini(dev);
- openchrome_mm_fini(dev_priv);
- openchrome_mmio_fini(dev_priv);
- openchrome_vram_fini(dev_priv);
+ via_mm_fini(dev_priv);
+ via_mmio_fini(dev_priv);
+ via_vram_fini(dev_priv);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
}
-void openchrome_drm_fini(struct drm_device *dev)
+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__);
via_modeset_fini(dev);
- openchrome_mm_fini(dev_priv);
- openchrome_mmio_fini(dev_priv);
- openchrome_vram_fini(dev_priv);
+ via_mm_fini(dev_priv);
+ via_mmio_fini(dev_priv);
+ via_vram_fini(dev_priv);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioctl.c b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
index 384b66906188..9dec4c77e36b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioctl.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
@@ -38,7 +38,7 @@
#include "openchrome_drv.h"
-static int openchrome_gem_create_ioctl(struct drm_device *dev,
+static int via_gem_create_ioctl(struct drm_device *dev,
void *data,
struct drm_file *file_priv)
{
@@ -50,13 +50,9 @@ static int openchrome_gem_create_ioctl(struct drm_device *dev,
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- ret = openchrome_bo_create(dev,
- &dev_priv->bdev,
- args->size,
- ttm_bo_type_device,
- args->domain,
- false,
- &bo);
+ ret = via_bo_create(dev, &dev_priv->bdev, args->size,
+ ttm_bo_type_device, args->domain, false,
+ &bo);
if (ret) {
goto exit;
@@ -66,7 +62,7 @@ static int openchrome_gem_create_ioctl(struct drm_device *dev,
&handle);
drm_gem_object_put(&bo->ttm_bo.base);
if (ret) {
- openchrome_bo_destroy(bo, false);
+ via_bo_destroy(bo, false);
goto exit;
}
@@ -79,7 +75,7 @@ exit:
return ret;
}
-static int openchrome_gem_map_ioctl(struct drm_device *dev,
+static int via_gem_map_ioctl(struct drm_device *dev,
void *data,
struct drm_file *file_priv)
{
@@ -107,7 +103,7 @@ exit:
return ret;
}
-static int openchrome_gem_unmap_ioctl(struct drm_device *dev,
+static int via_gem_unmap_ioctl(struct drm_device *dev,
void *data,
struct drm_file *file_priv)
{
@@ -124,9 +120,9 @@ static int openchrome_gem_unmap_ioctl(struct drm_device *dev,
const struct drm_ioctl_desc via_driver_ioctls[] = {
- DRM_IOCTL_DEF_DRV(OPENCHROME_GEM_CREATE, openchrome_gem_create_ioctl, DRM_AUTH | DRM_UNLOCKED),
- DRM_IOCTL_DEF_DRV(OPENCHROME_GEM_MAP, openchrome_gem_map_ioctl, DRM_AUTH | DRM_UNLOCKED),
- DRM_IOCTL_DEF_DRV(OPENCHROME_GEM_UNMAP, openchrome_gem_unmap_ioctl, DRM_AUTH | DRM_UNLOCKED),
+ DRM_IOCTL_DEF_DRV(OPENCHROME_GEM_CREATE, via_gem_create_ioctl, DRM_AUTH | DRM_UNLOCKED),
+ DRM_IOCTL_DEF_DRV(OPENCHROME_GEM_MAP, via_gem_map_ioctl, DRM_AUTH | DRM_UNLOCKED),
+ DRM_IOCTL_DEF_DRV(OPENCHROME_GEM_UNMAP, via_gem_unmap_ioctl, DRM_AUTH | DRM_UNLOCKED),
};
diff --git a/drivers/gpu/drm/openchrome/openchrome_lvds.c b/drivers/gpu/drm/openchrome/openchrome_lvds.c
index c18c66048f33..9a728c22f0f3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_lvds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_lvds.c
@@ -59,7 +59,7 @@ static via_lvds_info via_lvds_info_table[] = {
{1600, 1200}
};
-static bool openchrome_fp_probe_edid(struct i2c_adapter *i2c_bus)
+static bool via_fp_probe_edid(struct i2c_adapter *i2c_bus)
{
u8 out = 0x0;
u8 buf[8];
@@ -823,7 +823,7 @@ via_lvds_detect(struct drm_connector *connector, bool force)
continue;
}
- if (!openchrome_fp_probe_edid(i2c_bus)) {
+ if (!via_fp_probe_edid(i2c_bus)) {
i2c_bus_bit = i2c_bus_bit << 1;
continue;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c b/drivers/gpu/drm/openchrome/openchrome_object.c
index c5c12cbef305..ac18ebf77fdc 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -46,7 +46,7 @@
#include "openchrome_drv.h"
-static void openchrome_gem_free(struct drm_gem_object *obj)
+static void via_gem_free(struct drm_gem_object *obj)
{
struct ttm_buffer_object *ttm_bo;
struct via_bo *bo;
@@ -69,14 +69,14 @@ static const struct vm_operations_struct via_ttm_bo_vm_ops = {
};
static const struct drm_gem_object_funcs via_gem_object_funcs = {
- .free = openchrome_gem_free,
+ .free = via_gem_free,
.vmap = drm_gem_ttm_vmap,
.vunmap = drm_gem_ttm_vunmap,
.mmap = drm_gem_ttm_mmap,
.vm_ops = &via_ttm_bo_vm_ops,
};
-void openchrome_ttm_domain_to_placement(struct via_bo *bo,
+void via_ttm_domain_to_placement(struct via_bo *bo,
uint32_t ttm_domain)
{
unsigned i = 0;
@@ -116,7 +116,7 @@ void openchrome_ttm_domain_to_placement(struct via_bo *bo,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_ttm_bo_destroy(struct ttm_buffer_object *tbo)
+void via_ttm_bo_destroy(struct ttm_buffer_object *tbo)
{
struct via_bo *bo;
@@ -130,8 +130,7 @@ void openchrome_ttm_bo_destroy(struct ttm_buffer_object *tbo)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_bo_pin(struct via_bo *bo,
- uint32_t ttm_domain)
+int via_bo_pin(struct via_bo *bo, uint32_t ttm_domain)
{
struct ttm_operation_ctx ctx = {false, false};
int ret = 0;
@@ -142,7 +141,7 @@ int openchrome_bo_pin(struct via_bo *bo,
goto pin;
}
- openchrome_ttm_domain_to_placement(bo, ttm_domain);
+ via_ttm_domain_to_placement(bo, ttm_domain);
ret = ttm_bo_validate(&bo->ttm_bo, &bo->placement, &ctx);
if (ret) {
goto exit;
@@ -156,7 +155,7 @@ exit:
return ret;
}
-void openchrome_bo_unpin(struct via_bo *bo)
+void via_bo_unpin(struct via_bo *bo)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -165,7 +164,7 @@ void openchrome_bo_unpin(struct via_bo *bo)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_bo_create(struct drm_device *dev,
+int via_bo_create(struct drm_device *dev,
struct ttm_device *bdev,
uint64_t size,
enum ttm_bo_type type,
@@ -202,16 +201,11 @@ int openchrome_bo_create(struct drm_device *dev,
bo->ttm_bo.base.funcs = &via_gem_object_funcs;
- openchrome_ttm_domain_to_placement(bo, ttm_domain);
- ret = ttm_bo_init(&dev_priv->bdev,
- &bo->ttm_bo,
- size,
- type,
- &bo->placement,
- PAGE_SIZE >> PAGE_SHIFT,
- false,
- NULL, NULL,
- openchrome_ttm_bo_destroy);
+ via_ttm_domain_to_placement(bo, ttm_domain);
+ ret = ttm_bo_init(&dev_priv->bdev, &bo->ttm_bo,
+ size, type, &bo->placement,
+ PAGE_SIZE >> PAGE_SHIFT, false,
+ NULL, NULL, via_ttm_bo_destroy);
if (ret) {
DRM_ERROR("Cannot initialize a TTM object.\n");
goto exit;
@@ -224,7 +218,7 @@ int openchrome_bo_create(struct drm_device *dev,
goto exit;
}
- ret = openchrome_bo_pin(bo, ttm_domain);
+ ret = via_bo_pin(bo, ttm_domain);
ttm_bo_unreserve(&bo->ttm_bo);
if (ret) {
ttm_bo_put(&bo->ttm_bo);
@@ -249,7 +243,7 @@ exit:
return ret;
}
-void openchrome_bo_destroy(struct via_bo *bo, bool kmap)
+void via_bo_destroy(struct via_bo *bo, bool kmap)
{
int ret;
@@ -263,7 +257,7 @@ void openchrome_bo_destroy(struct via_bo *bo, bool kmap)
goto exit;
}
- openchrome_bo_unpin(bo);
+ via_bo_unpin(bo);
ttm_bo_unreserve(&bo->ttm_bo);
if (ret) {
goto exit;
@@ -275,7 +269,7 @@ exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_mm_init(struct via_drm_priv *dev_priv)
+int via_mm_init(struct via_drm_priv *dev_priv)
{
struct drm_device *dev = &dev_priv->dev;
int ret;
@@ -313,7 +307,7 @@ exit:
return ret;
}
-void openchrome_mm_fini(struct via_drm_priv *dev_priv)
+void via_mm_fini(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/openchrome/openchrome_pm.c b/drivers/gpu/drm/openchrome/openchrome_pm.c
index 02bd4d72b6ef..6adc0bdbfce9 100644
--- a/drivers/gpu/drm/openchrome/openchrome_pm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_pm.c
@@ -35,7 +35,7 @@
#include "openchrome_drv.h"
-int openchrome_dev_pm_ops_suspend(struct device *dev)
+int via_dev_pm_ops_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
@@ -97,7 +97,7 @@ exit:
return ret;
}
-int openchrome_dev_pm_ops_resume(struct device *dev)
+int via_dev_pm_ops_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/openchrome_sii164.c
index 3ebab1ad4750..4a90e64d31d4 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -41,8 +41,7 @@
#define SII164_PDB BIT(0)
-static void openchrome_sii164_power(struct i2c_adapter *i2c_bus,
- bool power_state)
+static void via_sii164_power(struct i2c_adapter *i2c_bus, bool power_state)
{
u8 buf;
u8 power_bit;
@@ -61,7 +60,7 @@ static void openchrome_sii164_power(struct i2c_adapter *i2c_bus,
}
-static bool openchrome_sii164_sense(struct i2c_adapter *i2c_bus)
+static bool via_sii164_sense(struct i2c_adapter *i2c_bus)
{
u8 buf;
bool rx_detected = false;
@@ -80,7 +79,7 @@ static bool openchrome_sii164_sense(struct i2c_adapter *i2c_bus)
return rx_detected;
}
-static void openchrome_sii164_display_registers(struct i2c_adapter *i2c_bus)
+static void via_sii164_display_registers(struct i2c_adapter *i2c_bus)
{
uint8_t i;
u8 buf;
@@ -96,7 +95,7 @@ static void openchrome_sii164_display_registers(struct i2c_adapter *i2c_bus)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_sii164_init_registers(struct i2c_adapter *i2c_bus)
+static void via_sii164_init_registers(struct i2c_adapter *i2c_bus)
{
u8 buf;
@@ -128,7 +127,7 @@ static const struct drm_encoder_funcs via_sii164_drm_encoder_funcs = {
.destroy = via_encoder_cleanup,
};
-static void openchrome_sii164_dpms(struct drm_encoder *encoder, int mode)
+static void via_sii164_dpms(struct drm_encoder *encoder, int mode)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -153,19 +152,17 @@ static void openchrome_sii164_dpms(struct drm_encoder *encoder, int mode)
goto exit;
}
- openchrome_sii164_display_registers(i2c_bus);
+ via_sii164_display_registers(i2c_bus);
switch (mode) {
case DRM_MODE_DPMS_ON:
- openchrome_sii164_power(i2c_bus, true);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port,
- true);
+ via_sii164_power(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:
- openchrome_sii164_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port,
- false);
+ via_sii164_power(i2c_bus, false);
+ via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
break;
default:
DRM_ERROR("Bad DPMS mode.");
@@ -176,7 +173,7 @@ exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static bool openchrome_sii164_mode_fixup(struct drm_encoder *encoder,
+static bool via_sii164_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -188,7 +185,7 @@ static bool openchrome_sii164_mode_fixup(struct drm_encoder *encoder,
return true;
}
-static void openchrome_sii164_mode_set(struct drm_encoder *encoder,
+static void via_sii164_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -216,24 +213,21 @@ static void openchrome_sii164_mode_set(struct drm_encoder *encoder,
goto exit;
}
- openchrome_transmitter_clock_drive_strength(dev_priv, enc->di_port,
- 0x03);
- openchrome_transmitter_data_drive_strength(dev_priv, enc->di_port,
- 0x03);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+ 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);
- openchrome_sii164_display_registers(i2c_bus);
- openchrome_sii164_init_registers(i2c_bus);
- openchrome_sii164_display_registers(i2c_bus);
+ via_sii164_display_registers(i2c_bus);
+ via_sii164_init_registers(i2c_bus);
+ via_sii164_display_registers(i2c_bus);
- openchrome_transmitter_display_source(dev_priv, enc->di_port,
- iga->index);
+ via_transmitter_display_source(dev_priv, enc->di_port, iga->index);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_sii164_prepare(struct drm_encoder *encoder)
+static void via_sii164_prepare(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -258,13 +252,13 @@ static void openchrome_sii164_prepare(struct drm_encoder *encoder)
goto exit;
}
- openchrome_sii164_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+ via_sii164_power(i2c_bus, false);
+ via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_sii164_commit(struct drm_encoder *encoder)
+static void via_sii164_commit(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -289,14 +283,14 @@ static void openchrome_sii164_commit(struct drm_encoder *encoder)
goto exit;
}
- openchrome_sii164_power(i2c_bus, true);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+ via_sii164_power(i2c_bus, true);
+ via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_sii164_disable(struct drm_encoder *encoder)
+static void via_sii164_disable(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -321,8 +315,8 @@ static void openchrome_sii164_disable(struct drm_encoder *encoder)
goto exit;
}
- openchrome_sii164_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+ via_sii164_power(i2c_bus, false);
+ via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -330,16 +324,16 @@ exit:
static const struct drm_encoder_helper_funcs
via_sii164_drm_encoder_helper_funcs = {
- .dpms = openchrome_sii164_dpms,
- .mode_fixup = openchrome_sii164_mode_fixup,
- .mode_set = openchrome_sii164_mode_set,
- .prepare = openchrome_sii164_prepare,
- .commit = openchrome_sii164_commit,
- .disable = openchrome_sii164_disable,
+ .dpms = via_sii164_dpms,
+ .mode_fixup = via_sii164_mode_fixup,
+ .mode_set = via_sii164_mode_set,
+ .prepare = via_sii164_prepare,
+ .commit = via_sii164_commit,
+ .disable = via_sii164_disable,
};
-static enum drm_connector_status openchrome_sii164_detect(
+static enum drm_connector_status via_sii164_detect(
struct drm_connector *connector,
bool force)
{
@@ -365,7 +359,7 @@ static enum drm_connector_status openchrome_sii164_detect(
goto exit;
}
- if (openchrome_sii164_sense(i2c_bus)) {
+ if (via_sii164_sense(i2c_bus)) {
ret = connector_status_connected;
DRM_DEBUG_KMS("DVI detected.\n");
}
@@ -377,7 +371,7 @@ exit:
static const struct drm_connector_funcs via_sii164_drm_connector_funcs = {
.dpms = drm_helper_connector_dpms,
- .detect = openchrome_sii164_detect,
+ .detect = via_sii164_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = via_connector_destroy,
.reset = drm_atomic_helper_connector_reset,
@@ -388,7 +382,7 @@ static const struct drm_connector_funcs via_sii164_drm_connector_funcs = {
};
-int openchrome_sii164_mode_valid(struct drm_connector *connector,
+int via_sii164_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct via_connector *con = container_of(connector,
@@ -439,7 +433,7 @@ exit:
return ret;
}
-static int openchrome_sii164_get_modes(struct drm_connector *connector)
+static int via_sii164_get_modes(struct drm_connector *connector)
{
struct via_connector *con = container_of(connector,
struct via_connector, base);
@@ -482,11 +476,11 @@ exit:
static const struct drm_connector_helper_funcs
via_sii164_drm_connector_helper_funcs = {
- .mode_valid = openchrome_sii164_mode_valid,
- .get_modes = openchrome_sii164_get_modes,
+ .mode_valid = via_sii164_mode_valid,
+ .get_modes = via_sii164_get_modes,
};
-bool openchrome_sii164_probe(struct i2c_adapter *i2c_bus)
+bool via_sii164_probe(struct i2c_adapter *i2c_bus)
{
u8 buf;
u16 vendor_id, device_id, revision;
@@ -518,7 +512,7 @@ exit:
return device_detected;
}
-void openchrome_sii164_init(struct drm_device *dev)
+void via_sii164_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/openchrome_tmds.c
index 24fa54f0922f..5658cede5167 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -530,7 +530,7 @@ exit:
/*
* Probe (pre-initialization detection) of external DVI transmitters.
*/
-void openchrome_ext_dvi_probe(struct drm_device *dev)
+void via_ext_dvi_probe(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -547,12 +547,12 @@ void openchrome_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 (openchrome_vt1632_probe(i2c_bus)) {
+ if (via_vt1632_probe(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;
dev_priv->mapped_i2c_bus |= VIA_I2C_BUS2;
- } else if (openchrome_sii164_probe(i2c_bus)) {
+ } else if (via_sii164_probe(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;
@@ -563,12 +563,12 @@ void openchrome_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 (openchrome_vt1632_probe(i2c_bus)) {
+ if (via_vt1632_probe(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;
dev_priv->mapped_i2c_bus |= VIA_I2C_BUS4;
- } else if (openchrome_sii164_probe(i2c_bus)) {
+ } else if (via_sii164_probe(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;
@@ -654,12 +654,12 @@ void openchrome_ext_dvi_probe(struct drm_device *dev)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_ext_dvi_init(struct drm_device *dev)
+void via_ext_dvi_init(struct drm_device *dev)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- openchrome_vt1632_init(dev);
- openchrome_sii164_init(dev);
+ via_vt1632_init(dev);
+ via_sii164_init(dev);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index c060f9ac2563..6327398d67d1 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -43,9 +43,8 @@
#include "openchrome_drv.h"
-static void openchrome_bo_move_notify(struct ttm_buffer_object *bo,
- bool evict,
- struct ttm_resource *new_mem)
+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__);
@@ -53,8 +52,7 @@ static void openchrome_bo_move_notify(struct ttm_buffer_object *bo,
return;
}
-static struct ttm_tt *openchrome_ttm_tt_create(
- struct ttm_buffer_object *bo,
+static struct ttm_tt *via_ttm_tt_create(struct ttm_buffer_object *bo,
uint32_t page_flags)
{
struct ttm_tt *tt;
@@ -75,32 +73,29 @@ err_ttm_tt_init:
return NULL;
}
-static void openchrome_ttm_tt_destroy(struct ttm_device *bdev,
- struct ttm_tt *tt)
+static void via_ttm_tt_destroy(struct ttm_device *bdev, struct ttm_tt *tt)
{
ttm_tt_fini(tt);
kfree(tt);
}
-static void openchrome_bo_evict_flags(struct ttm_buffer_object *bo,
- struct ttm_placement *placement)
+static void via_bo_evict_flags(struct ttm_buffer_object *bo,
+ struct ttm_placement *placement)
{
struct via_bo *driver_bo = to_ttm_bo(bo);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if (bo->destroy == &openchrome_ttm_bo_destroy) {
+ if (bo->destroy == &via_ttm_bo_destroy) {
goto exit;
}
switch (bo->resource->mem_type) {
case TTM_PL_VRAM:
- openchrome_ttm_domain_to_placement(driver_bo,
- TTM_PL_VRAM);
+ via_ttm_domain_to_placement(driver_bo, TTM_PL_VRAM);
break;
default:
- openchrome_ttm_domain_to_placement(driver_bo,
- TTM_PL_SYSTEM);
+ via_ttm_domain_to_placement(driver_bo, TTM_PL_SYSTEM);
break;
}
@@ -109,21 +104,20 @@ exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static int openchrome_bo_move(struct ttm_buffer_object *bo,
- bool evict,
- struct ttm_operation_ctx *ctx,
- struct ttm_resource *new_mem,
- struct ttm_place *hop)
+static int via_bo_move(struct ttm_buffer_object *bo, bool evict,
+ struct ttm_operation_ctx *ctx,
+ struct ttm_resource *new_mem,
+ struct ttm_place *hop)
{
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- openchrome_bo_move_notify(bo, evict, new_mem);
+ via_bo_move_notify(bo, evict, new_mem);
ret = ttm_bo_move_memcpy(bo, ctx, new_mem);
if (ret) {
swap(*new_mem, *bo->resource);
- openchrome_bo_move_notify(bo, false, new_mem);
+ via_bo_move_notify(bo, false, new_mem);
swap(*new_mem, *bo->resource);
}
@@ -131,17 +125,17 @@ static int openchrome_bo_move(struct ttm_buffer_object *bo,
return ret;
}
-static void openchrome_bo_delete_mem_notify(struct ttm_buffer_object *bo)
+static void via_bo_delete_mem_notify(struct ttm_buffer_object *bo)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- openchrome_bo_move_notify(bo, false, NULL);
+ via_bo_move_notify(bo, false, NULL);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return;
}
-static int openchrome_bo_io_mem_reserve(struct ttm_device *bdev,
+static int via_bo_io_mem_reserve(struct ttm_device *bdev,
struct ttm_resource *mem)
{
struct via_drm_priv *dev_priv = container_of(bdev,
@@ -168,11 +162,11 @@ static int openchrome_bo_io_mem_reserve(struct ttm_device *bdev,
}
struct ttm_device_funcs via_bo_driver = {
- .ttm_tt_create = openchrome_ttm_tt_create,
- .ttm_tt_destroy = openchrome_ttm_tt_destroy,
+ .ttm_tt_create = via_ttm_tt_create,
+ .ttm_tt_destroy = via_ttm_tt_destroy,
.eviction_valuable = ttm_bo_eviction_valuable,
- .evict_flags = openchrome_bo_evict_flags,
- .move = openchrome_bo_move,
- .delete_mem_notify = openchrome_bo_delete_mem_notify,
- .io_mem_reserve = openchrome_bo_io_mem_reserve,
+ .evict_flags = via_bo_evict_flags,
+ .move = via_bo_move,
+ .delete_mem_notify = via_bo_delete_mem_notify,
+ .io_mem_reserve = via_bo_io_mem_reserve,
};
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index dc776fbebd82..9b92ef9f708a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -41,8 +41,7 @@
#define VIA_VT1632_PDB BIT(0)
-static void openchrome_vt1632_power(struct i2c_adapter *i2c_bus,
- bool power_state)
+static void via_vt1632_power(struct i2c_adapter *i2c_bus, bool power_state)
{
u8 buf;
u8 power_bit;
@@ -61,7 +60,7 @@ static void openchrome_vt1632_power(struct i2c_adapter *i2c_bus,
}
-static bool openchrome_vt1632_sense(struct i2c_adapter *i2c_bus)
+static bool via_vt1632_sense(struct i2c_adapter *i2c_bus)
{
u8 buf;
bool rx_detected = false;
@@ -80,7 +79,7 @@ static bool openchrome_vt1632_sense(struct i2c_adapter *i2c_bus)
return rx_detected;
}
-static void openchrome_vt1632_display_registers(struct i2c_adapter *i2c_bus)
+static void via_vt1632_display_registers(struct i2c_adapter *i2c_bus)
{
uint8_t i;
u8 buf;
@@ -96,7 +95,7 @@ static void openchrome_vt1632_display_registers(struct i2c_adapter *i2c_bus)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_vt1632_init_registers(struct i2c_adapter *i2c_bus)
+static void via_vt1632_init_registers(struct i2c_adapter *i2c_bus)
{
u8 buf;
@@ -148,7 +147,7 @@ static const struct drm_encoder_funcs via_vt1632_drm_encoder_funcs = {
.destroy = via_encoder_cleanup,
};
-static void openchrome_vt1632_dpms(struct drm_encoder *encoder, int mode)
+static void via_vt1632_dpms(struct drm_encoder *encoder, int mode)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -173,19 +172,17 @@ static void openchrome_vt1632_dpms(struct drm_encoder *encoder, int mode)
goto exit;
}
- openchrome_vt1632_display_registers(i2c_bus);
+ via_vt1632_display_registers(i2c_bus);
switch (mode) {
case DRM_MODE_DPMS_ON:
- openchrome_vt1632_power(i2c_bus, true);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port,
- true);
+ via_vt1632_power(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:
- openchrome_vt1632_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port,
- false);
+ via_vt1632_power(i2c_bus, false);
+ via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
break;
default:
DRM_ERROR("Bad DPMS mode.");
@@ -196,7 +193,7 @@ exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static bool openchrome_vt1632_mode_fixup(struct drm_encoder *encoder,
+static bool via_vt1632_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -208,7 +205,7 @@ static bool openchrome_vt1632_mode_fixup(struct drm_encoder *encoder,
return true;
}
-static void openchrome_vt1632_mode_set(struct drm_encoder *encoder,
+static void via_vt1632_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -236,24 +233,21 @@ static void openchrome_vt1632_mode_set(struct drm_encoder *encoder,
goto exit;
}
- openchrome_transmitter_clock_drive_strength(dev_priv, enc->di_port,
- 0x03);
- openchrome_transmitter_data_drive_strength(dev_priv, enc->di_port,
- 0x03);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+ 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);
- openchrome_vt1632_display_registers(i2c_bus);
- openchrome_vt1632_init_registers(i2c_bus);
- openchrome_vt1632_display_registers(i2c_bus);
+ via_vt1632_display_registers(i2c_bus);
+ via_vt1632_init_registers(i2c_bus);
+ via_vt1632_display_registers(i2c_bus);
- openchrome_transmitter_display_source(dev_priv, enc->di_port,
- iga->index);
+ via_transmitter_display_source(dev_priv, enc->di_port, iga->index);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_vt1632_prepare(struct drm_encoder *encoder)
+static void via_vt1632_prepare(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -278,13 +272,13 @@ static void openchrome_vt1632_prepare(struct drm_encoder *encoder)
goto exit;
}
- openchrome_vt1632_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+ via_vt1632_power(i2c_bus, false);
+ via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_vt1632_commit(struct drm_encoder *encoder)
+static void via_vt1632_commit(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -309,14 +303,14 @@ static void openchrome_vt1632_commit(struct drm_encoder *encoder)
goto exit;
}
- openchrome_vt1632_power(i2c_bus, true);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, true);
+ via_vt1632_power(i2c_bus, true);
+ via_transmitter_io_pad_state(dev_priv, enc->di_port, true);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_vt1632_disable(struct drm_encoder *encoder)
+static void via_vt1632_disable(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -341,8 +335,8 @@ static void openchrome_vt1632_disable(struct drm_encoder *encoder)
goto exit;
}
- openchrome_vt1632_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, false);
+ via_vt1632_power(i2c_bus, false);
+ via_transmitter_io_pad_state(dev_priv, enc->di_port, false);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -350,16 +344,16 @@ exit:
static const struct drm_encoder_helper_funcs
via_vt1632_drm_encoder_helper_funcs = {
- .dpms = openchrome_vt1632_dpms,
- .mode_fixup = openchrome_vt1632_mode_fixup,
- .mode_set = openchrome_vt1632_mode_set,
- .prepare = openchrome_vt1632_prepare,
- .commit = openchrome_vt1632_commit,
- .disable = openchrome_vt1632_disable,
+ .dpms = via_vt1632_dpms,
+ .mode_fixup = via_vt1632_mode_fixup,
+ .mode_set = via_vt1632_mode_set,
+ .prepare = via_vt1632_prepare,
+ .commit = via_vt1632_commit,
+ .disable = via_vt1632_disable,
};
-static enum drm_connector_status openchrome_vt1632_detect(
+static enum drm_connector_status via_vt1632_detect(
struct drm_connector *connector,
bool force)
{
@@ -385,7 +379,7 @@ static enum drm_connector_status openchrome_vt1632_detect(
goto exit;
}
- if (openchrome_vt1632_sense(i2c_bus)) {
+ if (via_vt1632_sense(i2c_bus)) {
ret = connector_status_connected;
DRM_DEBUG_KMS("DVI detected.\n");
}
@@ -397,7 +391,7 @@ exit:
static const struct drm_connector_funcs via_vt1632_drm_connector_funcs = {
.dpms = drm_helper_connector_dpms,
- .detect = openchrome_vt1632_detect,
+ .detect = via_vt1632_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = via_connector_destroy,
.reset = drm_atomic_helper_connector_reset,
@@ -408,7 +402,7 @@ static const struct drm_connector_funcs via_vt1632_drm_connector_funcs = {
};
-int openchrome_vt1632_mode_valid(struct drm_connector *connector,
+int via_vt1632_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct via_connector *con = container_of(connector,
@@ -459,7 +453,7 @@ exit:
return ret;
}
-static int openchrome_vt1632_get_modes(struct drm_connector *connector)
+static int via_vt1632_get_modes(struct drm_connector *connector)
{
struct via_connector *con = container_of(connector,
struct via_connector, base);
@@ -502,11 +496,11 @@ exit:
static const struct drm_connector_helper_funcs
via_vt1632_drm_connector_helper_funcs = {
- .mode_valid = openchrome_vt1632_mode_valid,
- .get_modes = openchrome_vt1632_get_modes,
+ .mode_valid = via_vt1632_mode_valid,
+ .get_modes = via_vt1632_get_modes,
};
-bool openchrome_vt1632_probe(struct i2c_adapter *i2c_bus)
+bool via_vt1632_probe(struct i2c_adapter *i2c_bus)
{
u8 buf;
u16 vendor_id, device_id, revision;
@@ -538,7 +532,7 @@ exit:
return device_detected;
}
-void openchrome_vt1632_init(struct drm_device *dev)
+void via_vt1632_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
commit 8a3dbfc0e8260ee0f5fbf31ab7f5910b6618d97e
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:17:07 2022 -0500
drm/openchrome: Remove unnecessary inclusion of openchrome_crtc_hw.h
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/openchrome_sii164.c
index 2f87472ea7fe..3ebab1ad4750 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -31,7 +31,6 @@
#include <drm/drm_probe_helper.h>
#include "openchrome_drv.h"
-#include "openchrome_crtc_hw.h"
#define SII164_VEN BIT(5)
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index a30798ca86bf..dc776fbebd82 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -31,7 +31,6 @@
#include <drm/drm_probe_helper.h>
#include "openchrome_drv.h"
-#include "openchrome_crtc_hw.h"
#define VIA_VT1632_VEN BIT(5)
commit 859592db9783f1c887a06472999cf099d33dfc21
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:17:06 2022 -0500
drm/openchrome: Convert boot option variables from openchrome_* to via_*
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index fbb418840380..939475003c5d 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -49,13 +49,13 @@ extern const struct drm_ioctl_desc via_driver_ioctls[];
* For now, this device driver will be disabled, unless the
* user decides to enable it.
*/
-int openchrome_modeset = 0;
+int via_modeset = 0;
MODULE_PARM_DESC(modeset, "Enable DRM device driver "
"(Default: Disabled, "
"0 = Disabled,"
"1 = Enabled)");
-module_param_named(modeset, openchrome_modeset, int, 0400);
+module_param_named(modeset, via_modeset, int, 0400);
static int openchrome_driver_open(struct drm_device *dev,
struct drm_file *file_priv)
@@ -276,12 +276,12 @@ static int __init openchrome_init(void)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if ((openchrome_modeset == -1) &&
+ if ((via_modeset == -1) &&
(drm_firmware_drivers_only())) {
- openchrome_modeset = 0;
+ via_modeset = 0;
}
- if (!openchrome_modeset) {
+ if (!via_modeset) {
ret = -EINVAL;
goto exit;
}
@@ -299,7 +299,7 @@ static void __exit openchrome_exit(void)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if (!openchrome_modeset) {
+ if (!via_modeset) {
goto exit;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index 110545419e19..e077936bf4df 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -36,10 +36,10 @@
#define HDMI_AUDIO_ENABLED BIT(0)
-int openchrome_hdmi_audio = 0;
+int via_hdmi_audio = 0;
MODULE_PARM_DESC(audio, "HDMI Audio enable (1 = enable)");
-module_param_named(audio, openchrome_hdmi_audio, int, 0444);
+module_param_named(audio, via_hdmi_audio, int, 0444);
/*
* Routines for controlling stuff on the HDMI port
@@ -638,7 +638,7 @@ int via_hdmi_get_modes(struct drm_connector *connector)
if (edid->input & DRM_EDID_INPUT_DIGITAL) {
con = container_of(connector, struct via_connector, base);
- if (openchrome_hdmi_audio)
+ if (via_hdmi_audio)
con->flags |= drm_detect_monitor_audio(edid);
}
}
commit 77b2dc14df01444fbc6993f854ab014d0408ff32
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:17:04 2022 -0500
drm/openchrome: Rename openchrome_fp.c to openchrome_lvds.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/Makefile b/drivers/gpu/drm/openchrome/Makefile
index aec98acfe96e..f9b1f28d9182 100644
--- a/drivers/gpu/drm/openchrome/Makefile
+++ b/drivers/gpu/drm/openchrome/Makefile
@@ -10,11 +10,11 @@ openchrome-y := openchrome_crtc.o \
openchrome_display.o \
openchrome_drv.o \
openchrome_encoder.o \
- openchrome_fp.o \
openchrome_hdmi.o \
openchrome_i2c.o \
openchrome_init.o \
openchrome_ioctl.o \
+ openchrome_lvds.o \
openchrome_object.o \
openchrome_pll.o \
openchrome_pm.o \
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_lvds.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_fp.c
rename to drivers/gpu/drm/openchrome/openchrome_lvds.c
commit c340e787b5816ab1e86da91c372ab5cd526bb87c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:17:03 2022 -0500
drm/openchrome: Convert via_fp_* to via_lvds_*
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h b/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
index 7b6430c85d16..a673b72de321 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
@@ -365,8 +365,8 @@ static inline void via_dac_set_display_source(void __iomem *regs,
* Sets KM400 or later chipset's FP primary power sequence control
* type.
*/
-static inline void
-via_fp_set_primary_power_seq_type(void __iomem *regs, bool ctrl_type)
+static inline void via_lvds_set_primary_power_seq_type(void __iomem *regs,
+ bool ctrl_type)
{
/* 3X5.91[0] - FP Primary Power Sequence Control Type
* 0: Hardware Control
@@ -382,8 +382,8 @@ via_fp_set_primary_power_seq_type(void __iomem *regs, bool ctrl_type)
* Sets KM400 or later chipset's FP primary software controlled
* back light.
*/
-static inline void
-via_fp_set_primary_soft_back_light(void __iomem *regs, bool soft_on)
+static inline void via_lvds_set_primary_soft_back_light(void __iomem *regs,
+ bool soft_on)
{
/* 3X5.91[1] - FP Primary Software Back Light On
* 0: Off
@@ -398,8 +398,8 @@ via_fp_set_primary_soft_back_light(void __iomem *regs, bool soft_on)
* Sets KM400 or later chipset's FP primary software controlled
* VEE.
*/
-static inline void
-via_fp_set_primary_soft_vee(void __iomem *regs, bool soft_on)
+static inline void via_lvds_set_primary_soft_vee(void __iomem *regs,
+ bool soft_on)
{
/* 3X5.91[2] - FP Primary Software VEE On
* 0: Off
@@ -414,8 +414,8 @@ via_fp_set_primary_soft_vee(void __iomem *regs, bool soft_on)
* Sets KM400 or later chipset's FP primary software controlled
* data.
*/
-static inline void
-via_fp_set_primary_soft_data(void __iomem *regs, bool soft_on)
+static inline void via_lvds_set_primary_soft_data(void __iomem *regs,
+ bool soft_on)
{
/* 3X5.91[3] - FP Primary Software Data On
* 0: Off
@@ -430,8 +430,8 @@ via_fp_set_primary_soft_data(void __iomem *regs, bool soft_on)
* Sets KM400 or later chipset's FP primary software controlled
* VDD.
*/
-static inline void
-via_fp_set_primary_soft_vdd(void __iomem *regs, bool soft_on)
+static inline void via_lvds_set_primary_soft_vdd(void __iomem *regs,
+ bool soft_on)
{
/* 3X5.91[4] - FP Primary Software VDD On
* 0: Off
@@ -446,8 +446,8 @@ via_fp_set_primary_soft_vdd(void __iomem *regs, bool soft_on)
* Sets KM400 or later chipset's FP primary direct back
* light control.
*/
-static inline void
-via_fp_set_primary_direct_back_light_ctrl(void __iomem *regs, bool direct_on)
+static inline void via_lvds_set_primary_direct_back_light_ctrl(
+ void __iomem *regs, bool direct_on)
{
/* 3X5.91[6] - FP Primary Direct Back Light Control
* 0: On
@@ -462,8 +462,8 @@ via_fp_set_primary_direct_back_light_ctrl(void __iomem *regs, bool direct_on)
* Sets KM400 or later chipset's FP primary direct display
* period control.
*/
-static inline void
-via_fp_set_primary_direct_display_period(void __iomem *regs, bool direct_on)
+static inline void via_lvds_set_primary_direct_display_period(
+ void __iomem *regs, bool direct_on)
{
/* 3X5.91[7] - FP Primary Direct Display Period Control
* 0: On
@@ -478,8 +478,8 @@ via_fp_set_primary_direct_display_period(void __iomem *regs, bool direct_on)
* Sets KM400 or later chipset's FP primary hardware controlled
* power sequence.
*/
-static inline void
-via_fp_set_primary_hard_power(void __iomem *regs, bool power_state)
+static inline void via_lvds_set_primary_hard_power(void __iomem *regs,
+ bool power_state)
{
/* 3X5.6A[3] - FP Primary Hardware Controlled Power Sequence
* 0: Hardware Controlled Power Off
@@ -494,9 +494,8 @@ via_fp_set_primary_hard_power(void __iomem *regs, bool power_state)
* Sets CX700 / VX700 or later chipset's FP secondary
* power sequence control type.
*/
-static inline void
-via_fp_set_secondary_power_seq_type(void __iomem *regs,
- bool ctrl_type)
+static inline void via_lvds_set_secondary_power_seq_type(void __iomem *regs,
+ bool ctrl_type)
{
/* 3X5.D3[0] - FP Secondary Power Sequence Control Type
* 0: Hardware Control
@@ -512,9 +511,8 @@ via_fp_set_secondary_power_seq_type(void __iomem *regs,
* Sets CX700 / VX700 or later chipset's FP secondary
* software controlled back light.
*/
-static inline void
-via_fp_set_secondary_soft_back_light(void __iomem *regs,
- bool soft_on)
+static inline void via_lvds_set_secondary_soft_back_light(void __iomem *regs,
+ bool soft_on)
{
/* 3X5.D3[1] - FP Secondary Software Back Light On
* 0: Off
@@ -529,9 +527,8 @@ via_fp_set_secondary_soft_back_light(void __iomem *regs,
* Sets CX700 / VX700 or later chipset's FP secondary software
* controlled VEE.
*/
-static inline void
-via_fp_set_secondary_soft_vee(void __iomem *regs,
- bool soft_on)
+static inline void via_lvds_set_secondary_soft_vee(void __iomem *regs,
+ bool soft_on)
{
/* 3X5.D3[2] - FP Secondary Software VEE On
* 0: Off
@@ -546,9 +543,8 @@ via_fp_set_secondary_soft_vee(void __iomem *regs,
* Sets CX700 / VX700 or later chipset's FP secondary software
* controlled data.
*/
-static inline void
-via_fp_set_secondary_soft_data(void __iomem *regs,
- bool soft_on)
+static inline void via_lvds_set_secondary_soft_data(void __iomem *regs,
+ bool soft_on)
{
/* 3X5.D3[3] - FP Secondary Software Data On
* 0: Off
@@ -563,9 +559,8 @@ via_fp_set_secondary_soft_data(void __iomem *regs,
* Sets CX700 / VX700 or later chipset's FP secondary software
* controlled VDD.
*/
-static inline void
-via_fp_set_secondary_soft_vdd(void __iomem *regs,
- bool soft_on)
+static inline void via_lvds_set_secondary_soft_vdd(void __iomem *regs,
+ bool soft_on)
{
/* 3X5.D3[4] - FP Secondary Software VDD On
* 0: Off
@@ -580,9 +575,8 @@ via_fp_set_secondary_soft_vdd(void __iomem *regs,
* Sets CX700 / VX700 or later chipset's FP secondary direct back
* light control.
*/
-static inline void
-via_fp_set_secondary_direct_back_light_ctrl(void __iomem *regs,
- bool direct_on)
+static inline void via_lvds_set_secondary_direct_back_light_ctrl(
+ void __iomem *regs, bool direct_on)
{
/* 3X5.D3[6] - FP Secondary Direct Back Light Control
* 0: On
@@ -597,9 +591,8 @@ via_fp_set_secondary_direct_back_light_ctrl(void __iomem *regs,
* Sets CX700 / VX700 or later chipset's FP secondary direct
* display period control.
*/
-static inline void
-via_fp_set_secondary_direct_display_period(void __iomem *regs,
- bool direct_on)
+static inline void via_lvds_set_secondary_direct_display_period(
+ void __iomem *regs, bool direct_on)
{
/* 3X5.D3[7] - FP Secondary Direct Display Period Control
* 0: On
@@ -613,9 +606,8 @@ via_fp_set_secondary_direct_display_period(void __iomem *regs,
/*
* Sets FP secondary hardware controlled power sequence enable.
*/
-static inline void
-via_fp_set_secondary_hard_power(void __iomem *regs,
- bool power_state)
+static inline void via_lvds_set_secondary_hard_power(void __iomem *regs,
+ bool power_state)
{
/* 3X5.D4[1] - Secondary Power Hardware Power Sequence Enable
* 0: Off
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 729a82accc30..e64883c18a66 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -153,7 +153,7 @@ int via_modeset_init(struct drm_device *dev)
openchrome_ext_dvi_probe(dev);
via_tmds_probe(dev);
- via_fp_probe(dev);
+ via_lvds_probe(dev);
via_dac_probe(dev);
@@ -163,7 +163,7 @@ int via_modeset_init(struct drm_device *dev)
via_dac_init(dev);
- via_fp_init(dev);
+ via_lvds_init(dev);
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_VX900_VGA:
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 1d283d049559..8e31013fb091 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -145,10 +145,10 @@
#define VIA_TMDS_SII164 BIT(1)
-typedef struct _via_fp_info {
+typedef struct _via_lvds_info {
u32 x;
u32 y;
-} via_fp_info;
+} via_lvds_info;
struct via_crtc {
struct drm_crtc base;
@@ -437,7 +437,7 @@ bool openchrome_vt1632_probe(struct i2c_adapter *i2c_bus);
bool openchrome_sii164_probe(struct i2c_adapter *i2c_bus);
void openchrome_ext_dvi_probe(struct drm_device *dev);
void via_tmds_probe(struct drm_device *dev);
-void via_fp_probe(struct drm_device *dev);
+void via_lvds_probe(struct drm_device *dev);
void via_hdmi_init(struct drm_device *dev, u32 di_port);
void via_dac_init(struct drm_device *dev);
@@ -445,6 +445,6 @@ void openchrome_vt1632_init(struct drm_device *dev);
void openchrome_sii164_init(struct drm_device *dev);
void openchrome_ext_dvi_init(struct drm_device *dev);
void via_tmds_init(struct drm_device *dev);
-void via_fp_init(struct drm_device *dev);
+void via_lvds_init(struct drm_device *dev);
#endif /* _OPENCHROME_DRV_H */
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index 3714b7d085da..c18c66048f33 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -40,7 +40,7 @@
#define TD3 25
/* Non-I2C bus FP native screen resolution information table.*/
-static via_fp_info via_fp_info_table[] = {
+static via_lvds_info via_lvds_info_table[] = {
{ 640, 480},
{ 800, 600},
{1024, 768},
@@ -135,7 +135,7 @@ static void via_centering_timing(const struct drm_display_mode *mode,
adjusted_mode->crtc_vsync_end = adjusted_mode->vsync_end;
}
-static void via_fp_cle266_soft_power_seq(struct via_drm_priv *dev_priv,
+static void via_lvds_cle266_soft_power_seq(struct via_drm_priv *dev_priv,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -145,214 +145,214 @@ static void via_fp_cle266_soft_power_seq(struct via_drm_priv *dev_priv,
mdelay(25);
/* Turn on FP VDD rail. */
- via_fp_set_primary_soft_vdd(VGABASE, true);
+ via_lvds_set_primary_soft_vdd(VGABASE, true);
/* Wait for 510 ms. */
mdelay(510);
/* Turn on FP data transmission. */
- via_fp_set_primary_soft_data(VGABASE, true);
+ via_lvds_set_primary_soft_data(VGABASE, true);
/* Wait for 1 ms. */
mdelay(1);
/* Turn on FP VEE rail. */
- via_fp_set_primary_soft_vee(VGABASE, true);
+ via_lvds_set_primary_soft_vee(VGABASE, true);
/* Turn on FP back light. */
- via_fp_set_primary_soft_back_light(VGABASE, true);
+ via_lvds_set_primary_soft_back_light(VGABASE, true);
} else {
/* Wait for 1 ms. */
mdelay(1);
/* Turn off FP back light. */
- via_fp_set_primary_soft_back_light(VGABASE, false);
+ via_lvds_set_primary_soft_back_light(VGABASE, false);
/* Turn off FP VEE rail. */
- via_fp_set_primary_soft_vee(VGABASE, false);
+ via_lvds_set_primary_soft_vee(VGABASE, false);
/* Wait for 510 ms. */
mdelay(510);
/* Turn off FP data transmission. */
- via_fp_set_primary_soft_data(VGABASE, false);
+ via_lvds_set_primary_soft_data(VGABASE, false);
/* Wait for 25 ms. */
mdelay(25);
/* Turn off FP VDD rail. */
- via_fp_set_primary_soft_vdd(VGABASE, false);
+ via_lvds_set_primary_soft_vdd(VGABASE, false);
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_primary_soft_power_seq(struct via_drm_priv *dev_priv,
+static void via_lvds_primary_soft_power_seq(struct via_drm_priv *dev_priv,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
/* Turn off FP hardware power sequence. */
- via_fp_set_primary_hard_power(VGABASE, false);
+ via_lvds_set_primary_hard_power(VGABASE, false);
/* Use software FP power sequence control. */
- via_fp_set_primary_power_seq_type(VGABASE, false);
+ via_lvds_set_primary_power_seq_type(VGABASE, false);
if (power_state) {
/* Turn on FP display period. */
- via_fp_set_primary_direct_display_period(VGABASE, true);
+ via_lvds_set_primary_direct_display_period(VGABASE, true);
/* Wait for TD0 ms. */
mdelay(TD0);
/* Turn on FP VDD rail. */
- via_fp_set_primary_soft_vdd(VGABASE, true);
+ via_lvds_set_primary_soft_vdd(VGABASE, true);
/* Wait for TD1 ms. */
mdelay(TD1);
/* Turn on FP data transmission. */
- via_fp_set_primary_soft_data(VGABASE, true);
+ via_lvds_set_primary_soft_data(VGABASE, true);
/* Wait for TD2 ms. */
mdelay(TD2);
/* Turn on FP VEE rail. */
- via_fp_set_primary_soft_vee(VGABASE, true);
+ via_lvds_set_primary_soft_vee(VGABASE, true);
/* Wait for TD3 ms. */
mdelay(TD3);
/* Turn on FP back light. */
- via_fp_set_primary_soft_back_light(VGABASE, true);
+ via_lvds_set_primary_soft_back_light(VGABASE, true);
} else {
/* Turn off FP back light. */
- via_fp_set_primary_soft_back_light(VGABASE, false);
+ via_lvds_set_primary_soft_back_light(VGABASE, false);
/* Wait for TD3 ms. */
mdelay(TD3);
/* Turn off FP VEE rail. */
- via_fp_set_primary_soft_vee(VGABASE, false);
+ via_lvds_set_primary_soft_vee(VGABASE, false);
/* Wait for TD2 ms. */
mdelay(TD2);
/* Turn off FP data transmission. */
- via_fp_set_primary_soft_data(VGABASE, false);
+ via_lvds_set_primary_soft_data(VGABASE, false);
/* Wait for TD1 ms. */
mdelay(TD1);
/* Turn off FP VDD rail. */
- via_fp_set_primary_soft_vdd(VGABASE, false);
+ via_lvds_set_primary_soft_vdd(VGABASE, false);
/* Turn off FP display period. */
- via_fp_set_primary_direct_display_period(VGABASE, false);
+ via_lvds_set_primary_direct_display_period(VGABASE, false);
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_secondary_soft_power_seq(struct via_drm_priv *dev_priv,
+static void via_lvds_secondary_soft_power_seq(struct via_drm_priv *dev_priv,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
/* Turn off FP hardware power sequence. */
- via_fp_set_secondary_hard_power(VGABASE, false);
+ via_lvds_set_secondary_hard_power(VGABASE, false);
/* Use software FP power sequence control. */
- via_fp_set_secondary_power_seq_type(VGABASE, false);
+ via_lvds_set_secondary_power_seq_type(VGABASE, false);
if (power_state) {
/* Turn on FP display period. */
- via_fp_set_secondary_direct_display_period(VGABASE, true);
+ via_lvds_set_secondary_direct_display_period(VGABASE, true);
/* Wait for TD0 ms. */
mdelay(TD0);
/* Turn on FP VDD rail. */
- via_fp_set_secondary_soft_vdd(VGABASE, true);
+ via_lvds_set_secondary_soft_vdd(VGABASE, true);
/* Wait for TD1 ms. */
mdelay(TD1);
/* Turn on FP data transmission. */
- via_fp_set_secondary_soft_data(VGABASE, true);
+ via_lvds_set_secondary_soft_data(VGABASE, true);
/* Wait for TD2 ms. */
mdelay(TD2);
/* Turn on FP VEE rail. */
- via_fp_set_secondary_soft_vee(VGABASE, true);
+ via_lvds_set_secondary_soft_vee(VGABASE, true);
/* Wait for TD3 ms. */
mdelay(TD3);
/* Turn on FP back light. */
- via_fp_set_secondary_soft_back_light(VGABASE, true);
+ via_lvds_set_secondary_soft_back_light(VGABASE, true);
} else {
/* Turn off FP back light. */
- via_fp_set_secondary_soft_back_light(VGABASE, false);
+ via_lvds_set_secondary_soft_back_light(VGABASE, false);
/* Wait for TD3 ms. */
mdelay(TD3);
/* Turn off FP VEE rail. */
- via_fp_set_secondary_soft_vee(VGABASE, false);
+ via_lvds_set_secondary_soft_vee(VGABASE, false);
/* Wait for TD2 ms. */
mdelay(TD2);
/* Turn off FP data transmission. */
- via_fp_set_secondary_soft_data(VGABASE, false);
+ via_lvds_set_secondary_soft_data(VGABASE, false);
/* Wait for TD1 ms. */
mdelay(TD1);
/* Turn off FP VDD rail. */
- via_fp_set_secondary_soft_vdd(VGABASE, false);
+ via_lvds_set_secondary_soft_vdd(VGABASE, false);
/* Turn off FP display period. */
- via_fp_set_secondary_direct_display_period(VGABASE, false);
+ via_lvds_set_secondary_direct_display_period(VGABASE, false);
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_primary_hard_power_seq(struct via_drm_priv *dev_priv,
+static void via_lvds_primary_hard_power_seq(struct via_drm_priv *dev_priv,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
/* Use hardware FP power sequence control. */
- via_fp_set_primary_power_seq_type(VGABASE, true);
+ via_lvds_set_primary_power_seq_type(VGABASE, true);
if (power_state) {
/* Turn on FP display period. */
- via_fp_set_primary_direct_display_period(VGABASE, true);
+ via_lvds_set_primary_direct_display_period(VGABASE, true);
/* Turn on FP hardware power sequence. */
- via_fp_set_primary_hard_power(VGABASE, true);
+ via_lvds_set_primary_hard_power(VGABASE, true);
/* Turn on FP back light. */
- via_fp_set_primary_direct_back_light_ctrl(VGABASE, true);
+ via_lvds_set_primary_direct_back_light_ctrl(VGABASE, true);
} else {
/* Turn off FP back light. */
- via_fp_set_primary_direct_back_light_ctrl(VGABASE, false);
+ via_lvds_set_primary_direct_back_light_ctrl(VGABASE, false);
/* Turn off FP hardware power sequence. */
- via_fp_set_primary_hard_power(VGABASE, false);
+ via_lvds_set_primary_hard_power(VGABASE, false);
/* Turn on FP display period. */
- via_fp_set_primary_direct_display_period(VGABASE, false);
+ via_lvds_set_primary_direct_display_period(VGABASE, false);
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_power(struct via_drm_priv *dev_priv,
+static void via_lvds_power(struct via_drm_priv *dev_priv,
unsigned short device,
u32 di_port, bool power_state)
{
@@ -360,7 +360,7 @@ static void via_fp_power(struct via_drm_priv *dev_priv,
switch (device) {
case PCI_DEVICE_ID_VIA_CLE266:
- via_fp_cle266_soft_power_seq(dev_priv, power_state);
+ via_lvds_cle266_soft_power_seq(dev_priv, power_state);
break;
case PCI_DEVICE_ID_VIA_KM400:
case PCI_DEVICE_ID_VIA_CN700:
@@ -369,24 +369,24 @@ static void via_fp_power(struct via_drm_priv *dev_priv,
case PCI_DEVICE_ID_VIA_VT3343:
case PCI_DEVICE_ID_VIA_K8M890:
case PCI_DEVICE_ID_VIA_P4M900:
- via_fp_primary_hard_power_seq(dev_priv, power_state);
+ via_lvds_primary_hard_power_seq(dev_priv, power_state);
break;
case PCI_DEVICE_ID_VIA_VT3157:
case PCI_DEVICE_ID_VIA_VT1122:
if (di_port & VIA_DI_PORT_LVDS1) {
- via_fp_primary_soft_power_seq(dev_priv, power_state);
+ via_lvds_primary_soft_power_seq(dev_priv, power_state);
via_lvds1_set_power(VGABASE, power_state);
}
if (di_port & VIA_DI_PORT_LVDS2) {
- via_fp_secondary_soft_power_seq(dev_priv, power_state);
+ via_lvds_secondary_soft_power_seq(dev_priv, power_state);
via_lvds2_set_power(VGABASE, power_state);
}
break;
case PCI_DEVICE_ID_VIA_VX875:
case PCI_DEVICE_ID_VIA_VX900_VGA:
- via_fp_primary_hard_power_seq(dev_priv, power_state);
+ via_lvds_primary_hard_power_seq(dev_priv, power_state);
via_lvds1_set_power(VGABASE, power_state);
break;
default:
@@ -402,7 +402,7 @@ static void via_fp_power(struct via_drm_priv *dev_priv,
/*
* Sets flat panel I/O pad state.
*/
-static void via_fp_io_pad_setting(struct via_drm_priv *dev_priv,
+static void via_lvds_io_pad_setting(struct via_drm_priv *dev_priv,
u32 di_port, bool io_pad_on)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -445,7 +445,7 @@ static void via_fp_io_pad_setting(struct via_drm_priv *dev_priv,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_format(struct via_drm_priv *dev_priv,
+static void via_lvds_format(struct via_drm_priv *dev_priv,
u32 di_port, u8 format)
{
u8 temp = format & 0x01;
@@ -471,7 +471,7 @@ static void via_fp_format(struct via_drm_priv *dev_priv,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_output_format(struct via_drm_priv *dev_priv,
+static void via_lvds_output_format(struct via_drm_priv *dev_priv,
u32 di_port, u8 output_format)
{
u8 temp = output_format & 0x01;
@@ -497,7 +497,7 @@ static void via_fp_output_format(struct via_drm_priv *dev_priv,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_dithering(struct via_drm_priv *dev_priv,
+static void via_lvds_dithering(struct via_drm_priv *dev_priv,
u32 di_port, bool dithering)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -524,7 +524,7 @@ static void via_fp_dithering(struct via_drm_priv *dev_priv,
/*
* Sets flat panel display source.
*/
-static void via_fp_display_source(struct via_drm_priv *dev_priv,
+static void via_lvds_display_source(struct via_drm_priv *dev_priv,
u32 di_port, int index)
{
u8 display_source = index & 0x01;
@@ -572,7 +572,7 @@ static void via_fp_display_source(struct via_drm_priv *dev_priv,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_dpms(struct drm_encoder *encoder, int mode)
+static void via_lvds_dpms(struct drm_encoder *encoder, int mode)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -587,14 +587,14 @@ static void via_fp_dpms(struct drm_encoder *encoder, int mode)
switch (mode) {
case DRM_MODE_DPMS_ON:
- via_fp_power(dev_priv, chipset, enc->di_port, true);
- via_fp_io_pad_setting(dev_priv, enc->di_port, true);
+ via_lvds_power(dev_priv, chipset, enc->di_port, true);
+ via_lvds_io_pad_setting(dev_priv, enc->di_port, true);
break;
case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_OFF:
- via_fp_power(dev_priv, chipset, enc->di_port, false);
- via_fp_io_pad_setting(dev_priv, enc->di_port, false);
+ via_lvds_power(dev_priv, chipset, enc->di_port, false);
+ via_lvds_io_pad_setting(dev_priv, enc->di_port, false);
break;
default:
break;
@@ -667,7 +667,7 @@ static bool via_lvds_mode_fixup(struct drm_encoder *encoder,
return true;
}
-static void via_fp_prepare(struct drm_encoder *encoder)
+static void via_lvds_prepare(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -680,13 +680,13 @@ static void via_fp_prepare(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_fp_power(dev_priv, chipset, enc->di_port, false);
- via_fp_io_pad_setting(dev_priv, enc->di_port, false);
+ via_lvds_power(dev_priv, chipset, enc->di_port, false);
+ via_lvds_io_pad_setting(dev_priv, enc->di_port, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_commit(struct drm_encoder *encoder)
+static void via_lvds_commit(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -699,14 +699,14 @@ static void via_fp_commit(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_fp_power(dev_priv, chipset, enc->di_port, true);
- via_fp_io_pad_setting(dev_priv, enc->di_port, true);
+ via_lvds_power(dev_priv, chipset, enc->di_port, true);
+ via_lvds_io_pad_setting(dev_priv, enc->di_port, true);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void
-via_fp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
+via_lvds_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
@@ -735,24 +735,24 @@ via_fp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
case PCI_DEVICE_ID_VIA_VX875:
case PCI_DEVICE_ID_VIA_VX900_VGA:
/* OPENLDI Mode */
- via_fp_format(dev_priv, enc->di_port, 0x01);
+ via_lvds_format(dev_priv, enc->di_port, 0x01);
/* Sequential Mode */
- via_fp_output_format(dev_priv, enc->di_port, 0x01);
+ via_lvds_output_format(dev_priv, enc->di_port, 0x01);
/* Turn on dithering. */
- via_fp_dithering(dev_priv, enc->di_port, true);
+ via_lvds_dithering(dev_priv, enc->di_port, true);
break;
default:
break;
}
- via_fp_display_source(dev_priv, enc->di_port, iga->index);
+ via_lvds_display_source(dev_priv, enc->di_port, iga->index);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_disable(struct drm_encoder *encoder)
+static void via_lvds_disable(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
@@ -765,18 +765,18 @@ static void via_fp_disable(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_fp_power(dev_priv, chipset, enc->di_port, false);
- via_fp_io_pad_setting(dev_priv, enc->di_port, false);
+ via_lvds_power(dev_priv, chipset, enc->di_port, false);
+ via_lvds_io_pad_setting(dev_priv, enc->di_port, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
const struct drm_encoder_helper_funcs via_lvds_helper_funcs = {
- .dpms = via_fp_dpms,
- .prepare = via_fp_prepare,
- .commit = via_fp_commit,
- .mode_set = via_fp_mode_set,
- .disable = via_fp_disable,
+ .dpms = via_lvds_dpms,
+ .prepare = via_lvds_prepare,
+ .commit = via_lvds_commit,
+ .mode_set = via_lvds_mode_set,
+ .disable = via_lvds_disable,
};
const struct drm_encoder_funcs via_lvds_enc_funcs = {
@@ -785,7 +785,7 @@ const struct drm_encoder_funcs via_lvds_enc_funcs = {
/* Detect FP presence. */
static enum drm_connector_status
-via_fp_detect(struct drm_connector *connector, bool force)
+via_lvds_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -859,7 +859,7 @@ exit:
return ret;
}
-static int via_fp_set_property(struct drm_connector *connector,
+static int via_lvds_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t val)
{
@@ -900,9 +900,9 @@ exit:
return ret;
}
-struct drm_connector_funcs via_fp_connector_funcs = {
+struct drm_connector_funcs via_lvds_connector_funcs = {
.dpms = drm_helper_connector_dpms,
- .detect = via_fp_detect,
+ .detect = via_lvds_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = via_connector_destroy,
.reset = drm_atomic_helper_connector_reset,
@@ -913,7 +913,7 @@ struct drm_connector_funcs via_fp_connector_funcs = {
};
static int
-via_fp_get_modes(struct drm_connector *connector)
+via_lvds_get_modes(struct drm_connector *connector)
{
struct via_connector *con = container_of(connector, struct via_connector, base);
struct drm_device *dev = connector->dev;
@@ -989,8 +989,8 @@ via_fp_get_modes(struct drm_connector *connector)
reg_value = (vga_rcrt(VGABASE, 0x3f) & 0x0f);
hdisplay = vdisplay = 0;
- hdisplay = via_fp_info_table[reg_value].x;
- vdisplay = via_fp_info_table[reg_value].y;
+ hdisplay = via_lvds_info_table[reg_value].x;
+ vdisplay = via_lvds_info_table[reg_value].y;
if (hdisplay && vdisplay) {
native_mode = drm_cvt_mode(dev, hdisplay, vdisplay,
@@ -1010,7 +1010,7 @@ exit:
return count;
}
-static int via_fp_mode_valid(struct drm_connector *connector,
+static int via_lvds_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct drm_property *prop = connector->dev->mode_config.scaling_mode_property;
@@ -1059,14 +1059,14 @@ static int via_fp_mode_valid(struct drm_connector *connector,
return MODE_OK;
}
-struct drm_connector_helper_funcs via_fp_connector_helper_funcs = {
- .get_modes = via_fp_get_modes,
+struct drm_connector_helper_funcs via_lvds_connector_helper_funcs = {
+ .get_modes = via_lvds_get_modes,
};
/*
* Probe (pre-initialization detection) FP.
*/
-void via_fp_probe(struct drm_device *dev)
+void via_lvds_probe(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -1247,10 +1247,10 @@ void via_fp_probe(struct drm_device *dev)
memset(&connector, 0, sizeof(connector));
/* Register a connector only for I2C bus probing. */
- drm_connector_init(dev, &connector, &via_fp_connector_funcs,
+ drm_connector_init(dev, &connector, &via_lvds_connector_funcs,
DRM_MODE_CONNECTOR_LVDS);
drm_connector_helper_add(&connector,
- &via_fp_connector_helper_funcs);
+ &via_lvds_connector_helper_funcs);
drm_connector_register(&connector);
if ((dev_priv->int_fp1_presence)
@@ -1297,7 +1297,7 @@ void via_fp_probe(struct drm_device *dev)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void via_fp_init(struct drm_device *dev)
+void via_lvds_init(struct drm_device *dev)
{
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct via_connector *con;
@@ -1319,9 +1319,9 @@ void via_fp_init(struct drm_device *dev)
con = &enc->cons[0];
INIT_LIST_HEAD(&con->props);
- drm_connector_init(dev, &con->base, &via_fp_connector_funcs,
+ drm_connector_init(dev, &con->base, &via_lvds_connector_funcs,
DRM_MODE_CONNECTOR_LVDS);
- drm_connector_helper_add(&con->base, &via_fp_connector_helper_funcs);
+ drm_connector_helper_add(&con->base, &via_lvds_connector_helper_funcs);
drm_connector_register(&con->base);
if (dev_priv->int_fp1_presence) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/openchrome_tmds.c
index ba65a3083c5c..24fa54f0922f 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -84,21 +84,21 @@ static void via_tmds_init_reg(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
/* Turn off hardware controlled FP power on / off circuit. */
- via_fp_set_primary_hard_power(VGABASE, false);
+ via_lvds_set_primary_hard_power(VGABASE, false);
/* Use software FP power sequence control. */
- via_fp_set_primary_power_seq_type(VGABASE, false);
+ via_lvds_set_primary_power_seq_type(VGABASE, false);
/* Turn off software controlled primary FP power rails. */
- via_fp_set_primary_soft_vdd(VGABASE, false);
- via_fp_set_primary_soft_vee(VGABASE, false);
+ via_lvds_set_primary_soft_vdd(VGABASE, false);
+ via_lvds_set_primary_soft_vee(VGABASE, false);
/* Turn off software controlled primary FP back light
* control. */
- via_fp_set_primary_soft_back_light(VGABASE, false);
+ via_lvds_set_primary_soft_back_light(VGABASE, false);
/* Turn off direct control of FP back light. */
- via_fp_set_primary_direct_back_light_ctrl(VGABASE, false);
+ via_lvds_set_primary_direct_back_light_ctrl(VGABASE, false);
/* Activate DVI + LVDS2 mode. */
/* 3X5.D2[5:4] - Display Channel Select
commit f73a23d6de03c3bcc0eb77b89a4ca24b7d7aaa5a
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:17:01 2022 -0500
drm/openchrome: Rename *_castle_rock_* to *_cle266_*
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index b21df6350291..3714b7d085da 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -135,7 +135,7 @@ static void via_centering_timing(const struct drm_display_mode *mode,
adjusted_mode->crtc_vsync_end = adjusted_mode->vsync_end;
}
-static void via_fp_castle_rock_soft_power_seq(struct via_drm_priv *dev_priv,
+static void via_fp_cle266_soft_power_seq(struct via_drm_priv *dev_priv,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -360,7 +360,7 @@ static void via_fp_power(struct via_drm_priv *dev_priv,
switch (device) {
case PCI_DEVICE_ID_VIA_CLE266:
- via_fp_castle_rock_soft_power_seq(dev_priv, power_state);
+ via_fp_cle266_soft_power_seq(dev_priv, power_state);
break;
case PCI_DEVICE_ID_VIA_KM400:
case PCI_DEVICE_ID_VIA_CN700:
commit 886cba2b6593bbed4c269d0d1854dc4cf4c1cb99
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:17:00 2022 -0500
drm/openchrome: Rename openchrome_clocks.c to openchrome_pll.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/Makefile b/drivers/gpu/drm/openchrome/Makefile
index 0a94dbb9eae5..aec98acfe96e 100644
--- a/drivers/gpu/drm/openchrome/Makefile
+++ b/drivers/gpu/drm/openchrome/Makefile
@@ -3,8 +3,7 @@
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
ccflags-y := -Iinclude/drm
-openchrome-y := openchrome_clocks.o \
- openchrome_crtc.o \
+openchrome-y := openchrome_crtc.o \
openchrome_crtc_hw.o \
openchrome_cursor.o \
openchrome_dac.o \
@@ -17,6 +16,7 @@ openchrome-y := openchrome_clocks.o \
openchrome_init.o \
openchrome_ioctl.o \
openchrome_object.o \
+ openchrome_pll.o \
openchrome_pm.o \
openchrome_sii164.o \
openchrome_tmds.o \
diff --git a/drivers/gpu/drm/openchrome/openchrome_clocks.c b/drivers/gpu/drm/openchrome/openchrome_pll.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_clocks.c
rename to drivers/gpu/drm/openchrome/openchrome_pll.c
commit 400be90fbbc490b921816acd5972d5295aee961e
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:59 2022 -0500
drm/openchrome: Rename openchrome_analog.c to openchrome_dac.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/Makefile b/drivers/gpu/drm/openchrome/Makefile
index 7624fedde5d4..0a94dbb9eae5 100644
--- a/drivers/gpu/drm/openchrome/Makefile
+++ b/drivers/gpu/drm/openchrome/Makefile
@@ -3,11 +3,11 @@
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
ccflags-y := -Iinclude/drm
-openchrome-y := openchrome_analog.o \
- openchrome_clocks.o \
+openchrome-y := openchrome_clocks.o \
openchrome_crtc.o \
openchrome_crtc_hw.o \
openchrome_cursor.o \
+ openchrome_dac.o \
openchrome_display.o \
openchrome_drv.o \
openchrome_encoder.o \
diff --git a/drivers/gpu/drm/openchrome/openchrome_analog.c b/drivers/gpu/drm/openchrome/openchrome_dac.c
similarity index 100%
rename from drivers/gpu/drm/openchrome/openchrome_analog.c
rename to drivers/gpu/drm/openchrome/openchrome_dac.c
commit 3b65ecc692e5974e2112a4817b15ffb9b45aaba2
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:58 2022 -0500
drm/openchrome: Convert analog to DAC
DAC (Digital to Analog Converter) is the terminology used by other
DRM developers to describe analog VGA signals, so along with it.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_analog.c b/drivers/gpu/drm/openchrome/openchrome_analog.c
index 7237d311fa40..d53de52017e6 100644
--- a/drivers/gpu/drm/openchrome/openchrome_analog.c
+++ b/drivers/gpu/drm/openchrome/openchrome_analog.c
@@ -34,25 +34,24 @@
/*
- * Enables or disables analog (VGA) output.
+ * Enables or disables DAC (VGA) output.
*/
-static void via_analog_power(struct via_drm_priv *dev_priv,
- bool outputState)
+static void via_dac_power(struct via_drm_priv *dev_priv, bool outputState)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_analog_set_power(VGABASE, outputState);
- DRM_INFO("Analog (VGA) Power: %s\n",
+ via_dac_set_power(VGABASE, outputState);
+ DRM_INFO("DAC (VGA) Power: %s\n",
outputState ? "On" : "Off");
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
/*
- * Set analog (VGA) sync polarity.
+ * Set DAC (VGA) sync polarity.
*/
-static void via_analog_sync_polarity(struct via_drm_priv *dev_priv,
+static void via_dac_sync_polarity(struct via_drm_priv *dev_priv,
unsigned int flags)
{
u8 syncPolarity = 0x00;
@@ -67,43 +66,43 @@ static void via_analog_sync_polarity(struct via_drm_priv *dev_priv,
syncPolarity |= BIT(1);
}
- via_analog_set_sync_polarity(VGABASE, syncPolarity);
- DRM_INFO("Analog (VGA) Horizontal Sync Polarity: %s\n",
+ via_dac_set_sync_polarity(VGABASE, syncPolarity);
+ DRM_INFO("DAC (VGA) Horizontal Sync Polarity: %s\n",
(syncPolarity & BIT(0)) ? "-" : "+");
- DRM_INFO("Analog (VGA) Vertical Sync Polarity: %s\n",
+ DRM_INFO("DAC (VGA) Vertical Sync Polarity: %s\n",
(syncPolarity & BIT(1)) ? "-" : "+");
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
/*
- * Sets analog (VGA) display source.
+ * Sets DAC (VGA) display source.
*/
-static void via_analog_display_source(struct via_drm_priv *dev_priv,
+static void via_dac_display_source(struct via_drm_priv *dev_priv,
int index)
{
u8 displaySource = index;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_analog_set_display_source(VGABASE, displaySource & 0x01);
- DRM_INFO("Analog (VGA) Display Source: IGA%d\n",
+ 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__);
}
/*
- * Routines for controlling stuff on the analog port
+ * Routines for controlling stuff on the DAC port
*/
static const struct drm_encoder_funcs via_dac_enc_funcs = {
.destroy = via_encoder_cleanup,
};
/*
- * Manage the power state of analog (VGA) DAC.
+ * Manage the power state of DAC (VGA).
*/
-static void via_analog_dpms(struct drm_encoder *encoder, int mode)
+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);
@@ -112,20 +111,20 @@ static void via_analog_dpms(struct drm_encoder *encoder, int mode)
switch (mode) {
case DRM_MODE_DPMS_ON:
- via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_ON);
- via_analog_power(dev_priv, true);
+ via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_ON);
+ via_dac_power(dev_priv, true);
break;
case DRM_MODE_DPMS_STANDBY:
- via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_STANDBY);
- via_analog_power(dev_priv, true);
+ via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_STANDBY);
+ via_dac_power(dev_priv, true);
break;
case DRM_MODE_DPMS_SUSPEND:
- via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_SUSPEND);
- via_analog_power(dev_priv, true);
+ via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_SUSPEND);
+ via_dac_power(dev_priv, true);
break;
case DRM_MODE_DPMS_OFF:
- via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_OFF);
- via_analog_power(dev_priv, false);
+ via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_OFF);
+ via_dac_power(dev_priv, false);
break;
default:
DRM_ERROR("Bad DPMS mode.");
@@ -139,7 +138,7 @@ static void via_analog_dpms(struct drm_encoder *encoder, int mode)
* adjust it according to limitations or connector properties, and also
* a chance to reject the mode entirely. Useful for things like scaling.
*/
-static bool via_analog_mode_fixup(struct drm_encoder *encoder,
+static bool via_dac_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -148,9 +147,9 @@ static bool via_analog_mode_fixup(struct drm_encoder *encoder,
}
/*
- * Handle analog (VGA) mode setting.
+ * Handle DAC (VGA) mode setting.
*/
-static void via_analog_mode_set(struct drm_encoder *encoder,
+static void via_dac_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -160,13 +159,13 @@ static void via_analog_mode_set(struct drm_encoder *encoder,
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_analog_sync_polarity(dev_priv, adjusted_mode->flags);
- via_analog_display_source(dev_priv, iga->index);
+ via_dac_sync_polarity(dev_priv, adjusted_mode->flags);
+ via_dac_display_source(dev_priv, iga->index);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_analog_prepare(struct drm_encoder *encoder)
+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);
@@ -174,14 +173,14 @@ static void via_analog_prepare(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (encoder->crtc) {
- via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_OFF);
- via_analog_power(dev_priv, false);
+ via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_OFF);
+ via_dac_power(dev_priv, false);
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_analog_commit(struct drm_encoder *encoder)
+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);
@@ -189,37 +188,37 @@ static void via_analog_commit(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (encoder->crtc) {
- via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_ON);
- via_analog_power(dev_priv, true);
+ via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_ON);
+ via_dac_power(dev_priv, true);
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_analog_disable(struct drm_encoder *encoder)
+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__);
- via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_OFF);
- via_analog_power(dev_priv, false);
+ via_dac_set_dpms_control(VGABASE, VIA_DAC_DPMS_OFF);
+ via_dac_power(dev_priv, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static const struct drm_encoder_helper_funcs via_dac_enc_helper_funcs = {
- .dpms = via_analog_dpms,
- .mode_fixup = via_analog_mode_fixup,
- .mode_set = via_analog_mode_set,
- .prepare = via_analog_prepare,
- .commit = via_analog_commit,
- .disable = via_analog_disable,
+ .dpms = via_dac_dpms,
+ .mode_fixup = via_dac_mode_fixup,
+ .mode_set = via_dac_mode_set,
+ .prepare = via_dac_prepare,
+ .commit = via_dac_commit,
+ .disable = via_dac_disable,
};
static enum drm_connector_status
-via_analog_detect(struct drm_connector *connector, bool force)
+via_dac_detect(struct drm_connector *connector, bool force)
{
struct via_connector *con = container_of(connector,
struct via_connector, base);
@@ -270,9 +269,9 @@ exit:
return ret;
}
-static const struct drm_connector_funcs via_analog_connector_funcs = {
+static const struct drm_connector_funcs via_dac_connector_funcs = {
.dpms = drm_helper_connector_dpms,
- .detect = via_analog_detect,
+ .detect = via_dac_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = via_connector_destroy,
.reset = drm_atomic_helper_connector_reset,
@@ -282,7 +281,7 @@ static const struct drm_connector_funcs via_analog_connector_funcs = {
drm_atomic_helper_connector_destroy_state,
};
-static int via_analog_get_modes(struct drm_connector *connector)
+static int via_dac_get_modes(struct drm_connector *connector)
{
struct via_connector *con = container_of(connector,
struct via_connector, base);
@@ -338,12 +337,12 @@ exit:
}
static const struct drm_connector_helper_funcs
-via_analog_connector_helper_funcs = {
+via_dac_connector_helper_funcs = {
.mode_valid = via_connector_mode_valid,
- .get_modes = via_analog_get_modes,
+ .get_modes = via_dac_get_modes,
};
-void via_analog_probe(struct drm_device *dev)
+void via_dac_probe(struct drm_device *dev)
{
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -370,33 +369,33 @@ void via_analog_probe(struct drm_device *dev)
DRM_DEBUG_KMS("SR13: 0x%02x\n", sr13);
if (!(sr13 & BIT(2))) {
- dev_priv->analog_presence = true;
+ dev_priv->dac_presence = true;
DRM_DEBUG_KMS("Detected the presence of VGA.\n");
} else {
- dev_priv->analog_presence = false;
+ dev_priv->dac_presence = false;
}
/* Restore SR5A. */
vga_wseq(VGABASE, 0x5a, sr5a);
break;
default:
- dev_priv->analog_presence = true;
+ dev_priv->dac_presence = true;
DRM_DEBUG_KMS("Detected the presence of VGA.\n");
break;
}
- dev_priv->analog_i2c_bus = VIA_I2C_NONE;
+ dev_priv->dac_i2c_bus = VIA_I2C_NONE;
- if (dev_priv->analog_presence) {
- dev_priv->analog_i2c_bus = VIA_I2C_BUS2 | VIA_I2C_BUS1;
+ if (dev_priv->dac_presence) {
+ dev_priv->dac_i2c_bus = VIA_I2C_BUS2 | VIA_I2C_BUS1;
}
- dev_priv->mapped_i2c_bus |= dev_priv->analog_i2c_bus;
+ dev_priv->mapped_i2c_bus |= dev_priv->dac_i2c_bus;
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void via_analog_init(struct drm_device *dev)
+void via_dac_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
@@ -411,12 +410,12 @@ void via_analog_init(struct drm_device *dev)
INIT_LIST_HEAD(&con->props);
/* Piece together our connector */
- drm_connector_init(dev, &con->base, &via_analog_connector_funcs,
+ drm_connector_init(dev, &con->base, &via_dac_connector_funcs,
DRM_MODE_CONNECTOR_VGA);
- drm_connector_helper_add(&con->base, &via_analog_connector_helper_funcs);
+ drm_connector_helper_add(&con->base, &via_dac_connector_helper_funcs);
drm_connector_register(&con->base);
- con->i2c_bus = dev_priv->analog_i2c_bus;
+ con->i2c_bus = dev_priv->dac_i2c_bus;
con->base.doublescan_allowed = false;
con->base.interlace_allowed = true;
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h b/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
index b38a726c63e3..7b6430c85d16 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
@@ -30,11 +30,11 @@
#include <drm/drm_print.h>
-/* To be used with via_analog_set_dpms_control inline function. */
-#define VIA_ANALOG_DPMS_ON 0x00
-#define VIA_ANALOG_DPMS_STANDBY 0x01
-#define VIA_ANALOG_DPMS_SUSPEND 0x02
-#define VIA_ANALOG_DPMS_OFF 0x03
+/* To be used with via_dac_set_dpms_control inline function. */
+#define VIA_DAC_DPMS_ON 0x00
+#define VIA_DAC_DPMS_STANDBY 0x01
+#define VIA_DAC_DPMS_SUSPEND 0x02
+#define VIA_DAC_DPMS_OFF 0x03
struct vga_regset {
@@ -292,8 +292,7 @@ via_dvp1_set_display_source(void __iomem *regs, u8 display_source)
/*
* Sets analog (VGA) DAC power.
*/
-static inline void
-via_analog_set_power(void __iomem *regs, bool output_state)
+static inline void via_dac_set_power(void __iomem *regs, bool output_state)
{
/* 3X5.47[2] - DACOFF Backdoor Register
* 0: DAC on
@@ -307,8 +306,8 @@ via_analog_set_power(void __iomem *regs, bool output_state)
/*
* Sets analog (VGA) DPMS state.
*/
-static inline void
-via_analog_set_dpms_control(void __iomem *regs, u8 dpms_control)
+static inline void via_dac_set_dpms_control(void __iomem *regs,
+ u8 dpms_control)
{
/* 3X5.36[5:4] - DPMS Control
* 00: On
@@ -330,8 +329,8 @@ via_analog_set_dpms_control(void __iomem *regs, u8 dpms_control)
/*
* Sets analog (VGA) sync polarity.
*/
-static inline void
-via_analog_set_sync_polarity(void __iomem *regs, u8 sync_polarity)
+static inline void via_dac_set_sync_polarity(void __iomem *regs,
+ u8 sync_polarity)
{
/* 3C2[7] - Analog Vertical Sync Polarity
* 0: Positive
@@ -350,8 +349,8 @@ via_analog_set_sync_polarity(void __iomem *regs, u8 sync_polarity)
/*
* Sets analog (VGA) display source.
*/
-static inline void
-via_analog_set_display_source(void __iomem *regs, u8 display_source)
+static inline void via_dac_set_display_source(void __iomem *regs,
+ u8 display_source)
{
/* 3C5.16[6] - CRT Display Source
* 0: Primary Display Stream (IGA1)
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 18a355c52dad..729a82accc30 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -155,13 +155,13 @@ int via_modeset_init(struct drm_device *dev)
via_fp_probe(dev);
- via_analog_probe(dev);
+ via_dac_probe(dev);
openchrome_ext_dvi_init(dev);
via_tmds_init(dev);
- via_analog_init(dev);
+ via_dac_init(dev);
via_fp_init(dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index db306d2560c3..1d283d049559 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -276,8 +276,8 @@ struct via_drm_priv {
*/
bool is_samsung_nc20;
- bool analog_presence;
- u32 analog_i2c_bus;
+ bool dac_presence;
+ u32 dac_i2c_bus;
bool int_tmds_presence;
u32 int_tmds_di_port;
@@ -432,7 +432,7 @@ int via_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode);
void via_connector_destroy(struct drm_connector *connector);
-void via_analog_probe(struct drm_device *dev);
+void via_dac_probe(struct drm_device *dev);
bool openchrome_vt1632_probe(struct i2c_adapter *i2c_bus);
bool openchrome_sii164_probe(struct i2c_adapter *i2c_bus);
void openchrome_ext_dvi_probe(struct drm_device *dev);
@@ -440,7 +440,7 @@ void via_tmds_probe(struct drm_device *dev);
void via_fp_probe(struct drm_device *dev);
void via_hdmi_init(struct drm_device *dev, u32 di_port);
-void via_analog_init(struct drm_device *dev);
+void via_dac_init(struct drm_device *dev);
void openchrome_vt1632_init(struct drm_device *dev);
void openchrome_sii164_init(struct drm_device *dev);
void openchrome_ext_dvi_init(struct drm_device *dev);
commit 97755c506ef52413bdd775d1216e2d44391693a9
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:56 2022 -0500
drm/openchrome: Convert external interfacing openchrome_*[] to via_*[]
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 79d3d4f94276..f7c54d4a0f9c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -2225,7 +2225,7 @@ exit:
return ret;
}
-static const uint32_t openchrome_primary_formats[] = {
+static const uint32_t via_primary_formats[] = {
DRM_FORMAT_XRGB8888,
DRM_FORMAT_ARGB8888,
DRM_FORMAT_RGB888,
@@ -2255,8 +2255,8 @@ int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
&via_primary_drm_plane_helper_funcs);
ret = drm_universal_plane_init(dev, primary, possible_crtcs,
&via_primary_drm_plane_funcs,
- openchrome_primary_formats,
- ARRAY_SIZE(openchrome_primary_formats),
+ via_primary_formats,
+ ARRAY_SIZE(via_primary_formats),
NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
if (ret) {
DRM_ERROR("Failed to initialize a primary "
@@ -2275,8 +2275,8 @@ int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
&via_cursor_drm_plane_helper_funcs);
ret = drm_universal_plane_init(dev, cursor, possible_crtcs,
&via_cursor_drm_plane_funcs,
- openchrome_cursor_formats,
- openchrome_cursor_formats_size,
+ via_cursor_formats,
+ via_cursor_formats_size,
NULL, DRM_PLANE_TYPE_CURSOR, NULL);
if (ret) {
DRM_ERROR("Failed to initialize a cursor "
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index 81a829d2678e..68bbdc793aaa 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -419,9 +419,9 @@ const struct drm_plane_funcs via_cursor_drm_plane_funcs = {
.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
};
-const uint32_t openchrome_cursor_formats[] = {
+const uint32_t via_cursor_formats[] = {
DRM_FORMAT_ARGB8888,
};
-const unsigned int openchrome_cursor_formats_size =
- ARRAY_SIZE(openchrome_cursor_formats);
+const unsigned int via_cursor_formats_size =
+ ARRAY_SIZE(via_cursor_formats);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index b0de5ffad8bb..db306d2560c3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -396,8 +396,8 @@ void openchrome_transmitter_display_source(struct via_drm_priv *dev_priv,
extern const struct drm_plane_helper_funcs via_cursor_drm_plane_helper_funcs;
extern const struct drm_plane_funcs via_cursor_drm_plane_funcs;
-extern const uint32_t openchrome_cursor_formats[];
-extern const unsigned int openchrome_cursor_formats_size;
+extern const uint32_t via_cursor_formats[];
+extern const unsigned int via_cursor_formats_size;
/* display */
int via_modeset_init(struct drm_device *dev);
commit ea7b669306c2dce8f894023e222cf7c5a76bec24
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:55 2022 -0500
drm/openchrome: Convert external interfacing openchrome_*{} to via_*{}
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 563f193b5bab..79d3d4f94276 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -340,7 +340,7 @@ static void openchrome_crtc_destroy(struct drm_crtc *crtc)
kfree(iga);
}
-static const struct drm_crtc_funcs openchrome_drm_crtc_funcs = {
+static const struct drm_crtc_funcs via_drm_crtc_funcs = {
.reset = drm_atomic_helper_crtc_reset,
.gamma_set = openchrome_gamma_set,
.set_config = drm_atomic_helper_set_config,
@@ -1828,8 +1828,7 @@ static void openchrome_crtc_helper_atomic_disable(struct drm_crtc *crtc,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static const struct drm_crtc_helper_funcs
-openchrome_drm_crtc_helper_funcs = {
+static const struct drm_crtc_helper_funcs via_drm_crtc_helper_funcs = {
.mode_set_nofb = openchrome_mode_set_nofb,
.atomic_enable = openchrome_crtc_helper_atomic_enable,
.atomic_disable = openchrome_crtc_helper_atomic_disable,
@@ -2021,7 +2020,7 @@ exit:
}
static const struct drm_plane_helper_funcs
-openchrome_primary_drm_plane_helper_funcs = {
+via_primary_drm_plane_helper_funcs = {
.prepare_fb = openchrome_primary_prepare_fb,
.cleanup_fb = openchrome_primary_cleanup_fb,
.atomic_check = openchrome_primary_atomic_check,
@@ -2029,7 +2028,7 @@ openchrome_primary_drm_plane_helper_funcs = {
.atomic_disable = openchrome_primary_atomic_disable,
};
-static const struct drm_plane_funcs openchrome_primary_drm_plane_funcs = {
+static const struct drm_plane_funcs via_primary_drm_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = drm_plane_cleanup,
@@ -2253,9 +2252,9 @@ int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
}
drm_plane_helper_add(primary,
- &openchrome_primary_drm_plane_helper_funcs);
+ &via_primary_drm_plane_helper_funcs);
ret = drm_universal_plane_init(dev, primary, possible_crtcs,
- &openchrome_primary_drm_plane_funcs,
+ &via_primary_drm_plane_funcs,
openchrome_primary_formats,
ARRAY_SIZE(openchrome_primary_formats),
NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
@@ -2273,9 +2272,9 @@ int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
}
drm_plane_helper_add(cursor,
- &openchrome_cursor_drm_plane_helper_funcs);
+ &via_cursor_drm_plane_helper_funcs);
ret = drm_universal_plane_init(dev, cursor, possible_crtcs,
- &openchrome_cursor_drm_plane_funcs,
+ &via_cursor_drm_plane_funcs,
openchrome_cursor_formats,
openchrome_cursor_formats_size,
NULL, DRM_PLANE_TYPE_CURSOR, NULL);
@@ -2293,10 +2292,10 @@ int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
}
drm_crtc_helper_add(&iga->base,
- &openchrome_drm_crtc_helper_funcs);
+ &via_drm_crtc_helper_funcs);
ret = drm_crtc_init_with_planes(dev, &iga->base,
primary, cursor,
- &openchrome_drm_crtc_funcs,
+ &via_drm_crtc_funcs,
NULL);
if (ret) {
DRM_ERROR("Failed to initialize CRTC!\n");
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index afc0e248c718..81a829d2678e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -402,8 +402,7 @@ void openchrome_cursor_atomic_disable(struct drm_plane *plane,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-const struct drm_plane_helper_funcs
-openchrome_cursor_drm_plane_helper_funcs = {
+const struct drm_plane_helper_funcs via_cursor_drm_plane_helper_funcs = {
.prepare_fb = openchrome_cursor_prepare_fb,
.cleanup_fb = openchrome_cursor_cleanup_fb,
.atomic_check = openchrome_cursor_atomic_check,
@@ -411,7 +410,7 @@ openchrome_cursor_drm_plane_helper_funcs = {
.atomic_disable = openchrome_cursor_atomic_disable,
};
-const struct drm_plane_funcs openchrome_cursor_drm_plane_funcs = {
+const struct drm_plane_funcs via_cursor_drm_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = drm_plane_cleanup,
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 0ad5f9e371f6..fbb418840380 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -43,7 +43,7 @@
#include "openchrome_drv.h"
-extern const struct drm_ioctl_desc openchrome_driver_ioctls[];
+extern const struct drm_ioctl_desc via_driver_ioctls[];
/*
* For now, this device driver will be disabled, unless the
@@ -156,7 +156,7 @@ exit:
return ret;
}
-static const struct file_operations openchrome_driver_fops = {
+static const struct file_operations via_driver_fops = {
.owner = THIS_MODULE,
.open = drm_open,
.release = drm_release,
@@ -166,7 +166,7 @@ static const struct file_operations openchrome_driver_fops = {
.llseek = noop_llseek,
};
-static struct drm_driver openchrome_driver = {
+static struct drm_driver via_driver = {
.driver_features = DRIVER_HAVE_IRQ |
DRIVER_GEM |
DRIVER_MODESET |
@@ -177,8 +177,8 @@ static struct drm_driver openchrome_driver = {
.gem_prime_mmap = drm_gem_prime_mmap,
.dumb_create = openchrome_driver_dumb_create,
.dumb_map_offset = openchrome_driver_dumb_map_offset,
- .ioctls = openchrome_driver_ioctls,
- .fops = &openchrome_driver_fops,
+ .ioctls = via_driver_ioctls,
+ .fops = &via_driver_fops,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
.date = DRIVER_DATE,
@@ -187,11 +187,11 @@ static struct drm_driver openchrome_driver = {
.patchlevel = DRIVER_PATCHLEVEL,
};
-static struct pci_device_id openchrome_pci_table[] = {
+static struct pci_device_id via_pci_table[] = {
viadrv_PCI_IDS,
};
-MODULE_DEVICE_TABLE(pci, openchrome_pci_table);
+MODULE_DEVICE_TABLE(pci, via_pci_table);
static int openchrome_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
@@ -203,7 +203,7 @@ static int openchrome_pci_probe(struct pci_dev *pdev,
DRM_DEBUG_KMS("Entered %s.\n", __func__);
ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev,
- &openchrome_driver);
+ &via_driver);
if (ret) {
goto exit;
}
@@ -214,7 +214,7 @@ static int openchrome_pci_probe(struct pci_dev *pdev,
}
dev_priv = devm_drm_dev_alloc(&pdev->dev,
- &openchrome_driver,
+ &via_driver,
struct via_drm_priv,
dev);
if (IS_ERR(dev_priv)) {
@@ -257,17 +257,17 @@ static void openchrome_pci_remove(struct pci_dev *pdev)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static const struct dev_pm_ops openchrome_dev_pm_ops = {
+static const struct dev_pm_ops via_dev_pm_ops = {
.suspend = openchrome_dev_pm_ops_suspend,
.resume = openchrome_dev_pm_ops_resume,
};
-static struct pci_driver openchrome_pci_driver = {
+static struct pci_driver via_pci_driver = {
.name = DRIVER_NAME,
- .id_table = openchrome_pci_table,
+ .id_table = via_pci_table,
.probe = openchrome_pci_probe,
.remove = openchrome_pci_remove,
- .driver.pm = &openchrome_dev_pm_ops,
+ .driver.pm = &via_dev_pm_ops,
};
static int __init openchrome_init(void)
@@ -286,9 +286,9 @@ static int __init openchrome_init(void)
goto exit;
}
- openchrome_driver.num_ioctls = openchrome_driver_num_ioctls;
+ via_driver.num_ioctls = via_driver_num_ioctls;
- ret = pci_register_driver(&openchrome_pci_driver);
+ ret = pci_register_driver(&via_pci_driver);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -303,7 +303,7 @@ static void __exit openchrome_exit(void)
goto exit;
}
- pci_unregister_driver(&openchrome_pci_driver);
+ pci_unregister_driver(&via_pci_driver);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index fbfaba0d803e..b0de5ffad8bb 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -346,9 +346,9 @@ via_unlock_crtc(void __iomem *regs, int pci_id)
}
-extern int openchrome_driver_num_ioctls;
+extern int via_driver_num_ioctls;
-extern struct ttm_device_funcs openchrome_bo_driver;
+extern struct ttm_device_funcs via_bo_driver;
int openchrome_vram_detect(struct via_drm_priv *dev_priv);
int openchrome_vram_init(struct via_drm_priv *dev_priv);
@@ -394,9 +394,8 @@ void openchrome_transmitter_data_drive_strength(
void openchrome_transmitter_display_source(struct via_drm_priv *dev_priv,
u32 di_port, int index);
-extern const struct drm_plane_helper_funcs
-openchrome_cursor_drm_plane_helper_funcs;
-extern const struct drm_plane_funcs openchrome_cursor_drm_plane_funcs;
+extern const struct drm_plane_helper_funcs via_cursor_drm_plane_helper_funcs;
+extern const struct drm_plane_funcs via_cursor_drm_plane_funcs;
extern const uint32_t openchrome_cursor_formats[];
extern const unsigned int openchrome_cursor_formats_size;
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 60c22b610eb2..5991c6c72c0b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1208,8 +1208,7 @@ void openchrome_device_fini(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static const struct drm_mode_config_funcs
-openchrome_drm_mode_config_funcs = {
+static const struct drm_mode_config_funcs via_drm_mode_config_funcs = {
.fb_create = drm_gem_fb_create,
.atomic_check = drm_atomic_helper_check,
.atomic_commit = drm_atomic_helper_commit,
@@ -1228,7 +1227,7 @@ void openchrome_mode_config_init(struct via_drm_priv *dev_priv)
dev->mode_config.max_width = 2044;
dev->mode_config.max_height = 4096;
- dev->mode_config.funcs = &openchrome_drm_mode_config_funcs;
+ dev->mode_config.funcs = &via_drm_mode_config_funcs;
dev->mode_config.fb_base = dev_priv->vram_start;
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioctl.c b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
index 9b7a40134d43..384b66906188 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioctl.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
@@ -123,11 +123,11 @@ static int openchrome_gem_unmap_ioctl(struct drm_device *dev,
}
-const struct drm_ioctl_desc openchrome_driver_ioctls[] = {
+const struct drm_ioctl_desc via_driver_ioctls[] = {
DRM_IOCTL_DEF_DRV(OPENCHROME_GEM_CREATE, openchrome_gem_create_ioctl, DRM_AUTH | DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(OPENCHROME_GEM_MAP, openchrome_gem_map_ioctl, DRM_AUTH | DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(OPENCHROME_GEM_UNMAP, openchrome_gem_unmap_ioctl, DRM_AUTH | DRM_UNLOCKED),
};
-int openchrome_driver_num_ioctls = ARRAY_SIZE(openchrome_driver_ioctls);
+int via_driver_num_ioctls = ARRAY_SIZE(via_driver_ioctls);
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c b/drivers/gpu/drm/openchrome/openchrome_object.c
index 947f1b5ac5ad..c5c12cbef305 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -61,19 +61,19 @@ static void openchrome_gem_free(struct drm_gem_object *obj)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static const struct vm_operations_struct openchrome_ttm_bo_vm_ops = {
+static const struct vm_operations_struct via_ttm_bo_vm_ops = {
.fault = ttm_bo_vm_fault,
.open = ttm_bo_vm_open,
.close = ttm_bo_vm_close,
.access = ttm_bo_vm_access
};
-static const struct drm_gem_object_funcs openchrome_gem_object_funcs = {
+static const struct drm_gem_object_funcs via_gem_object_funcs = {
.free = openchrome_gem_free,
.vmap = drm_gem_ttm_vmap,
.vunmap = drm_gem_ttm_vunmap,
.mmap = drm_gem_ttm_mmap,
- .vm_ops = &openchrome_ttm_bo_vm_ops,
+ .vm_ops = &via_ttm_bo_vm_ops,
};
void openchrome_ttm_domain_to_placement(struct via_bo *bo,
@@ -200,7 +200,7 @@ int openchrome_bo_create(struct drm_device *dev,
goto error;
}
- bo->ttm_bo.base.funcs = &openchrome_gem_object_funcs;
+ bo->ttm_bo.base.funcs = &via_gem_object_funcs;
openchrome_ttm_domain_to_placement(bo, ttm_domain);
ret = ttm_bo_init(&dev_priv->bdev,
@@ -286,7 +286,7 @@ int openchrome_mm_init(struct via_drm_priv *dev_priv)
* Initialize bdev ttm_bo_device struct.
*/
ret = ttm_device_init(&dev_priv->bdev,
- &openchrome_bo_driver,
+ &via_bo_driver,
dev->dev,
dev->anon_inode->i_mapping,
dev->vma_offset_manager,
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/openchrome_sii164.c
index 112685feef97..2f87472ea7fe 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -125,7 +125,7 @@ static void openchrome_sii164_init_registers(struct i2c_adapter *i2c_bus)
}
-static const struct drm_encoder_funcs openchrome_sii164_drm_encoder_funcs = {
+static const struct drm_encoder_funcs via_sii164_drm_encoder_funcs = {
.destroy = via_encoder_cleanup,
};
@@ -330,7 +330,7 @@ exit:
static const struct drm_encoder_helper_funcs
-openchrome_sii164_drm_encoder_helper_funcs = {
+via_sii164_drm_encoder_helper_funcs = {
.dpms = openchrome_sii164_dpms,
.mode_fixup = openchrome_sii164_mode_fixup,
.mode_set = openchrome_sii164_mode_set,
@@ -376,8 +376,7 @@ exit:
return ret;
}
-static const struct drm_connector_funcs
-openchrome_sii164_drm_connector_funcs = {
+static const struct drm_connector_funcs via_sii164_drm_connector_funcs = {
.dpms = drm_helper_connector_dpms,
.detect = openchrome_sii164_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
@@ -483,7 +482,7 @@ exit:
}
static const struct drm_connector_helper_funcs
-openchrome_sii164_drm_connector_helper_funcs = {
+via_sii164_drm_connector_helper_funcs = {
.mode_valid = openchrome_sii164_mode_valid,
.get_modes = openchrome_sii164_get_modes,
};
@@ -539,9 +538,10 @@ void openchrome_sii164_init(struct drm_device *dev)
goto exit;
}
- drm_encoder_init(dev, &enc->base, &openchrome_sii164_drm_encoder_funcs,
+ drm_encoder_init(dev, &enc->base, &via_sii164_drm_encoder_funcs,
DRM_MODE_ENCODER_TMDS, NULL);
- drm_encoder_helper_add(&enc->base, &openchrome_sii164_drm_encoder_helper_funcs);
+ drm_encoder_helper_add(&enc->base,
+ &via_sii164_drm_encoder_helper_funcs);
enc->base.possible_crtcs = BIT(1) | BIT(0);
enc->base.possible_clones = 0;
@@ -555,9 +555,10 @@ void openchrome_sii164_init(struct drm_device *dev)
con = &enc->cons[0];
- drm_connector_init(dev, &con->base, &openchrome_sii164_drm_connector_funcs,
+ drm_connector_init(dev, &con->base, &via_sii164_drm_connector_funcs,
DRM_MODE_CONNECTOR_DVID);
- drm_connector_helper_add(&con->base, &openchrome_sii164_drm_connector_helper_funcs);
+ drm_connector_helper_add(&con->base,
+ &via_sii164_drm_connector_helper_funcs);
drm_connector_register(&con->base);
con->base.doublescan_allowed = false;
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index f098f831f1c2..c060f9ac2563 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -167,7 +167,7 @@ static int openchrome_bo_io_mem_reserve(struct ttm_device *bdev,
return ret;
}
-struct ttm_device_funcs openchrome_bo_driver = {
+struct ttm_device_funcs via_bo_driver = {
.ttm_tt_create = openchrome_ttm_tt_create,
.ttm_tt_destroy = openchrome_ttm_tt_destroy,
.eviction_valuable = ttm_bo_eviction_valuable,
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index 715158a6215e..a30798ca86bf 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -145,7 +145,7 @@ static void openchrome_vt1632_init_registers(struct i2c_adapter *i2c_bus)
}
-static const struct drm_encoder_funcs openchrome_vt1632_drm_encoder_funcs = {
+static const struct drm_encoder_funcs via_vt1632_drm_encoder_funcs = {
.destroy = via_encoder_cleanup,
};
@@ -350,7 +350,7 @@ exit:
static const struct drm_encoder_helper_funcs
-openchrome_vt1632_drm_encoder_helper_funcs = {
+via_vt1632_drm_encoder_helper_funcs = {
.dpms = openchrome_vt1632_dpms,
.mode_fixup = openchrome_vt1632_mode_fixup,
.mode_set = openchrome_vt1632_mode_set,
@@ -396,8 +396,7 @@ exit:
return ret;
}
-static const struct drm_connector_funcs
-openchrome_vt1632_drm_connector_funcs = {
+static const struct drm_connector_funcs via_vt1632_drm_connector_funcs = {
.dpms = drm_helper_connector_dpms,
.detect = openchrome_vt1632_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
@@ -503,7 +502,7 @@ exit:
}
static const struct drm_connector_helper_funcs
-openchrome_vt1632_drm_connector_helper_funcs = {
+via_vt1632_drm_connector_helper_funcs = {
.mode_valid = openchrome_vt1632_mode_valid,
.get_modes = openchrome_vt1632_get_modes,
};
@@ -559,9 +558,10 @@ void openchrome_vt1632_init(struct drm_device *dev)
goto exit;
}
- drm_encoder_init(dev, &enc->base, &openchrome_vt1632_drm_encoder_funcs,
+ drm_encoder_init(dev, &enc->base, &via_vt1632_drm_encoder_funcs,
DRM_MODE_ENCODER_TMDS, NULL);
- drm_encoder_helper_add(&enc->base, &openchrome_vt1632_drm_encoder_helper_funcs);
+ drm_encoder_helper_add(&enc->base,
+ &via_vt1632_drm_encoder_helper_funcs);
enc->base.possible_crtcs = BIT(1) | BIT(0);
enc->base.possible_clones = 0;
@@ -575,9 +575,10 @@ void openchrome_vt1632_init(struct drm_device *dev)
con = &enc->cons[0];
- drm_connector_init(dev, &con->base, &openchrome_vt1632_drm_connector_funcs,
+ drm_connector_init(dev, &con->base, &via_vt1632_drm_connector_funcs,
DRM_MODE_CONNECTOR_DVID);
- drm_connector_helper_add(&con->base, &openchrome_vt1632_drm_connector_helper_funcs);
+ drm_connector_helper_add(&con->base,
+ &via_vt1632_drm_connector_helper_funcs);
drm_connector_register(&con->base);
con->base.doublescan_allowed = false;
commit d8b93562bb1659d0aa8d76dca7cced3d81525b6f
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:54 2022 -0500
drm/openchrome: Convert internally used openchrome_*{} to via_*{}
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index f51c34ca9efe..563f193b5bab 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1903,7 +1903,7 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
- struct openchrome_bo *bo;
+ struct via_bo *bo;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1966,7 +1966,7 @@ static int openchrome_primary_prepare_fb(struct drm_plane *plane,
{
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
- struct openchrome_bo *bo;
+ struct via_bo *bo;
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1996,7 +1996,7 @@ static void openchrome_primary_cleanup_fb(struct drm_plane *plane,
{
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
- struct openchrome_bo *bo;
+ struct via_bo *bo;
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index b50dc1d430c8..afc0e248c718 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -261,7 +261,7 @@ static int openchrome_cursor_prepare_fb(struct drm_plane *plane,
{
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
- struct openchrome_bo *bo;
+ struct via_bo *bo;
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -298,7 +298,7 @@ static void openchrome_cursor_cleanup_fb(struct drm_plane *plane,
{
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
- struct openchrome_bo *bo;
+ struct via_bo *bo;
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 3ccdf4dcaa1d..0ad5f9e371f6 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -90,7 +90,7 @@ static int openchrome_driver_dumb_create(struct drm_file *file_priv,
struct drm_mode_create_dumb *args)
{
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
- struct openchrome_bo *bo;
+ struct via_bo *bo;
uint32_t handle, pitch;
uint64_t size;
int ret;
@@ -135,7 +135,7 @@ static int openchrome_driver_dumb_map_offset(struct drm_file *file_priv,
{
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
- struct openchrome_bo *bo;
+ struct via_bo *bo;
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 2865509892d5..fbfaba0d803e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -183,7 +183,7 @@ struct via_state {
struct vga_regset seq_regs[256];
};
-struct openchrome_bo {
+struct via_bo {
struct ttm_buffer_object ttm_bo;
struct ttm_bo_kmap_obj kmap;
struct ttm_placement placement;
@@ -310,7 +310,7 @@ struct via_drm_priv {
* Shortcut for using container_of macro.
*/
#define to_via_drm_priv(x) container_of(x, struct via_drm_priv, dev)
-#define to_ttm_bo(x) container_of(x, struct openchrome_bo, ttm_bo)
+#define to_ttm_bo(x) container_of(x, struct via_bo, ttm_bo)
/* VIA MMIO register access */
@@ -366,19 +366,19 @@ void openchrome_drm_fini(struct drm_device *dev);
int openchrome_dev_pm_ops_suspend(struct device *dev);
int openchrome_dev_pm_ops_resume(struct device *dev);
-void openchrome_ttm_domain_to_placement(struct openchrome_bo *bo,
+void openchrome_ttm_domain_to_placement(struct via_bo *bo,
uint32_t ttm_domain);
void openchrome_ttm_bo_destroy(struct ttm_buffer_object *tbo);
-int openchrome_bo_pin(struct openchrome_bo *bo, uint32_t ttm_domain);
-void openchrome_bo_unpin(struct openchrome_bo *bo);
+int openchrome_bo_pin(struct via_bo *bo, uint32_t ttm_domain);
+void openchrome_bo_unpin(struct via_bo *bo);
int openchrome_bo_create(struct drm_device *dev,
struct ttm_device *bdev,
uint64_t size,
enum ttm_bo_type type,
uint32_t ttm_domain,
bool kmap,
- struct openchrome_bo **bo_ptr);
-void openchrome_bo_destroy(struct openchrome_bo *bo, bool kmap);
+ struct via_bo **bo_ptr);
+void openchrome_bo_destroy(struct via_bo *bo, bool kmap);
int openchrome_mm_init(struct via_drm_priv *dev_priv);
void openchrome_mm_fini(struct via_drm_priv *dev_priv);
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioctl.c b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
index dd195a1aafcf..9b7a40134d43 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioctl.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
@@ -44,7 +44,7 @@ static int openchrome_gem_create_ioctl(struct drm_device *dev,
{
struct drm_openchrome_gem_create *args = data;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
- struct openchrome_bo *bo;
+ struct via_bo *bo;
uint32_t handle;
int ret;
@@ -86,7 +86,7 @@ static int openchrome_gem_map_ioctl(struct drm_device *dev,
struct drm_openchrome_gem_map *args = data;
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
- struct openchrome_bo *bo;
+ struct via_bo *bo;
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c b/drivers/gpu/drm/openchrome/openchrome_object.c
index 57a4e65776f0..947f1b5ac5ad 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -49,7 +49,7 @@
static void openchrome_gem_free(struct drm_gem_object *obj)
{
struct ttm_buffer_object *ttm_bo;
- struct openchrome_bo *bo;
+ struct via_bo *bo;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -76,7 +76,7 @@ static const struct drm_gem_object_funcs openchrome_gem_object_funcs = {
.vm_ops = &openchrome_ttm_bo_vm_ops,
};
-void openchrome_ttm_domain_to_placement(struct openchrome_bo *bo,
+void openchrome_ttm_domain_to_placement(struct via_bo *bo,
uint32_t ttm_domain)
{
unsigned i = 0;
@@ -118,7 +118,7 @@ void openchrome_ttm_domain_to_placement(struct openchrome_bo *bo,
void openchrome_ttm_bo_destroy(struct ttm_buffer_object *tbo)
{
- struct openchrome_bo *bo;
+ struct via_bo *bo;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -130,7 +130,7 @@ void openchrome_ttm_bo_destroy(struct ttm_buffer_object *tbo)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_bo_pin(struct openchrome_bo *bo,
+int openchrome_bo_pin(struct via_bo *bo,
uint32_t ttm_domain)
{
struct ttm_operation_ctx ctx = {false, false};
@@ -156,7 +156,7 @@ exit:
return ret;
}
-void openchrome_bo_unpin(struct openchrome_bo *bo)
+void openchrome_bo_unpin(struct via_bo *bo)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -171,15 +171,15 @@ int openchrome_bo_create(struct drm_device *dev,
enum ttm_bo_type type,
uint32_t ttm_domain,
bool kmap,
- struct openchrome_bo **bo_ptr)
+ struct via_bo **bo_ptr)
{
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
- struct openchrome_bo *bo;
+ struct via_bo *bo;
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
-// bo = kzalloc(sizeof(struct openchrome_bo), GFP_KERNEL);
+// bo = kzalloc(sizeof(struct via_bo), GFP_KERNEL);
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
if (!bo) {
DRM_ERROR("Cannot allocate a TTM buffer object.\n");
@@ -249,7 +249,7 @@ exit:
return ret;
}
-void openchrome_bo_destroy(struct openchrome_bo *bo, bool kmap)
+void openchrome_bo_destroy(struct via_bo *bo, bool kmap)
{
int ret;
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index c3653a3ef4ab..f098f831f1c2 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -85,7 +85,7 @@ static void openchrome_ttm_tt_destroy(struct ttm_device *bdev,
static void openchrome_bo_evict_flags(struct ttm_buffer_object *bo,
struct ttm_placement *placement)
{
- struct openchrome_bo *driver_bo = to_ttm_bo(bo);
+ struct via_bo *driver_bo = to_ttm_bo(bo);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
commit d50900969aa2119ce33d8c32ec0e8a9c5dafbd3c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:53 2022 -0500
drm/openchrome: Convert OPENCHROME_* macros to VIA_*
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 14edb2410af8..18a355c52dad 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -143,7 +143,7 @@ int via_modeset_init(struct drm_device *dev)
goto exit;
}
- for (i = 0; i < OPENCHROME_MAX_CRTC; i++) {
+ for (i = 0; i < VIA_MAX_CRTC; i++) {
ret = openchrome_crtc_init(dev_priv, i);
if (ret) {
goto exit;
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index fbbc5fb69699..2865509892d5 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -61,11 +61,11 @@
#define DRIVER_AUTHOR "OpenChrome Project"
-#define OPENCHROME_TTM_PL_NUM 2
+#define VIA_TTM_PL_NUM 2
-#define OPENCHROME_MAX_CRTC 2
+#define VIA_MAX_CRTC 2
-#define OPENCHROME_CURSOR_SIZE 64
+#define VIA_CURSOR_SIZE 64
#define VIA_MM_ALIGN_SIZE 16
@@ -187,7 +187,7 @@ struct openchrome_bo {
struct ttm_buffer_object ttm_bo;
struct ttm_bo_kmap_obj kmap;
struct ttm_placement placement;
- struct ttm_place placements[OPENCHROME_TTM_PL_NUM];
+ struct ttm_place placements[VIA_TTM_PL_NUM];
};
enum via_engine {
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 5741bd7ef8ab..60c22b610eb2 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1236,7 +1236,7 @@ void openchrome_mode_config_init(struct via_drm_priv *dev_priv)
dev->mode_config.prefer_shadow_fbdev = true;
dev->mode_config.cursor_width =
- dev->mode_config.cursor_height = OPENCHROME_CURSOR_SIZE;
+ dev->mode_config.cursor_height = VIA_CURSOR_SIZE;
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
commit 57a0bf727ef65a93d89b764a29b5f5716c4da76e
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:52 2022 -0500
drm/openchrome: Use to_ttm_bo macro to find ttm_bo{}
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index a4014315319c..f51c34ca9efe 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1909,7 +1909,7 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
gem = fb->obj[0];
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
- bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
+ bo = to_ttm_bo(ttm_bo);
if (!iga->index) {
via_iga1_set_color_depth(dev_priv, fb->format->depth);
@@ -1977,7 +1977,7 @@ static int openchrome_primary_prepare_fb(struct drm_plane *plane,
gem = new_state->fb->obj[0];
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
- bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
+ bo = to_ttm_bo(ttm_bo);
ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
if (ret) {
@@ -2007,7 +2007,7 @@ static void openchrome_primary_cleanup_fb(struct drm_plane *plane,
gem = old_state->fb->obj[0];
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
- bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
+ bo = to_ttm_bo(ttm_bo);
ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
if (ret) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index c3fbf530bda2..b50dc1d430c8 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -272,7 +272,7 @@ static int openchrome_cursor_prepare_fb(struct drm_plane *plane,
gem = new_state->fb->obj[0];
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
- bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
+ bo = to_ttm_bo(ttm_bo);
ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
if (ret) {
@@ -309,7 +309,7 @@ static void openchrome_cursor_cleanup_fb(struct drm_plane *plane,
gem = old_state->fb->obj[0];
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
- bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
+ bo = to_ttm_bo(ttm_bo);
ttm_bo_kunmap(&bo->kmap);
ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 1b75122c31eb..3ccdf4dcaa1d 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -147,7 +147,7 @@ static int openchrome_driver_dumb_map_offset(struct drm_file *file_priv,
}
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
- bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
+ bo = to_ttm_bo(ttm_bo);
*offset = drm_vma_node_offset_addr(&bo->ttm_bo.base.vma_node);
drm_gem_object_put(gem);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 2c6d8a5fddf0..fbbc5fb69699 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -310,6 +310,7 @@ struct via_drm_priv {
* Shortcut for using container_of macro.
*/
#define to_via_drm_priv(x) container_of(x, struct via_drm_priv, dev)
+#define to_ttm_bo(x) container_of(x, struct openchrome_bo, ttm_bo)
/* VIA MMIO register access */
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioctl.c b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
index 1b0e743be363..dd195a1aafcf 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioctl.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
@@ -98,7 +98,7 @@ static int openchrome_gem_map_ioctl(struct drm_device *dev,
}
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
- bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
+ bo = to_ttm_bo(ttm_bo);
args->map_offset = drm_vma_node_offset_addr(
&bo->ttm_bo.base.vma_node);
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c b/drivers/gpu/drm/openchrome/openchrome_object.c
index bd476e01393c..57a4e65776f0 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -54,7 +54,7 @@ static void openchrome_gem_free(struct drm_gem_object *obj)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
ttm_bo = container_of(obj, struct ttm_buffer_object, base);
- bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
+ bo = to_ttm_bo(ttm_bo);
ttm_bo_put(&bo->ttm_bo);
@@ -122,7 +122,7 @@ void openchrome_ttm_bo_destroy(struct ttm_buffer_object *tbo)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- bo = container_of(tbo, struct openchrome_bo, ttm_bo);
+ bo = to_ttm_bo(tbo);
drm_gem_object_release(&bo->ttm_bo.base);
kfree(bo);
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index 7555268b5041..c3653a3ef4ab 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -85,8 +85,7 @@ static void openchrome_ttm_tt_destroy(struct ttm_device *bdev,
static void openchrome_bo_evict_flags(struct ttm_buffer_object *bo,
struct ttm_placement *placement)
{
- struct openchrome_bo *driver_bo = container_of(bo,
- struct openchrome_bo, ttm_bo);
+ struct openchrome_bo *driver_bo = to_ttm_bo(bo);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
commit 36ebbc32766e8cba5756673f30d805e8be0479b2
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:51 2022 -0500
drm/openchrome: Use TTM BO for openchrome_cursor_address() parameter
This simplifies the code.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index 52eba86d6b9a..c3fbf530bda2 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -160,7 +160,7 @@ static void openchrome_show_cursor(struct drm_crtc *crtc)
}
static void openchrome_cursor_address(struct drm_crtc *crtc,
- struct openchrome_bo *ttm_bo)
+ struct ttm_buffer_object *ttm_bo)
{
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -180,18 +180,17 @@ static void openchrome_cursor_address(struct drm_crtc *crtc,
*/
if (iga->index) {
VIA_WRITE(HI_FBOFFSET,
- ttm_bo->kmap.bo->resource->start << PAGE_SHIFT);
+ ttm_bo->resource->start << PAGE_SHIFT);
} else {
VIA_WRITE(PRIM_HI_FBOFFSET,
- ttm_bo->kmap.bo->resource->start << PAGE_SHIFT);
+ ttm_bo->resource->start << PAGE_SHIFT);
}
break;
default:
/*
* Program Hardware Icon (HI) offset.
*/
- VIA_WRITE(HI_FBOFFSET,
- ttm_bo->kmap.bo->resource->start << PAGE_SHIFT);
+ VIA_WRITE(HI_FBOFFSET, ttm_bo->resource->start << PAGE_SHIFT);
break;
}
@@ -370,15 +369,13 @@ static void openchrome_cursor_atomic_update(struct drm_plane *plane,
struct drm_crtc *crtc = new_state->crtc;
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
- struct openchrome_bo *bo;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (new_state->fb != old_state->fb) {
gem = new_state->fb->obj[0];
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
- bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
- openchrome_cursor_address(crtc, bo);
+ openchrome_cursor_address(crtc, ttm_bo);
}
openchrome_set_hi_location(crtc,
commit d2e0665bb7d2498fffd5b478c261a8054e0afe42
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:50 2022 -0500
drm/openchrome: Remove openchrome_framebuffer{}
Commit 2680490 (drm/openchrome: Adopt DRM FBDEV helpers) should have
also gotten rid of openchrome_framebuffer{}.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 50f6232de834..2c6d8a5fddf0 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -190,11 +190,6 @@ struct openchrome_bo {
struct ttm_place placements[OPENCHROME_TTM_PL_NUM];
};
-struct openchrome_framebuffer {
- struct drm_fb_helper helper;
- struct openchrome_bo *bo;
-};
-
enum via_engine {
VIA_ENG_H1 = 0,
VIA_ENG_H2,
@@ -213,7 +208,6 @@ struct via_drm_priv {
int revision;
- struct openchrome_framebuffer *openchrome_fb;
u8 vram_type;
resource_size_t vram_start;
resource_size_t vram_size;
commit 296bf815e94d50e8aa0dcb54a348725fa9303ca5
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:48 2022 -0500
drm/openchrome: Remove unnecessary white spaces
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index f0f0d6a8e8ef..b21df6350291 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -615,7 +615,7 @@ static bool via_lvds_mode_fixup(struct drm_encoder *encoder,
struct drm_device *dev = encoder->dev;
list_for_each_entry(con, &dev->mode_config.connector_list, head) {
- if (encoder == con->encoder) {
+ if (encoder == con->encoder) {
connector = con;
break;
}
@@ -785,7 +785,7 @@ const struct drm_encoder_funcs via_lvds_enc_funcs = {
/* Detect FP presence. */
static enum drm_connector_status
-via_fp_detect(struct drm_connector *connector, bool force)
+via_fp_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index 7a8e16662590..110545419e19 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -252,7 +252,7 @@ static void via_hdmi_enc_mode_set(struct drm_encoder *encoder,
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
list_for_each_entry(con, &dev->mode_config.connector_list, head) {
- if (encoder == con->encoder) {
+ if (encoder == con->encoder) {
connector = con;
break;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index a1cdcb6e3411..5741bd7ef8ab 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -841,7 +841,7 @@ int openchrome_vram_detect(struct via_drm_priv *dev_priv)
dev_priv->vram_size <<= 2;
ret = cn700_mem_type(dev_priv, fn3);
- if (ret)
+ if (ret)
goto out_err;
break;
commit af51a13df81227cd27534aa288977ed924134e6f
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:47 2022 -0500
drm/openchrome: Replace white spaces with tabs
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_clocks.c b/drivers/gpu/drm/openchrome/openchrome_clocks.c
index 8bf2f48792c1..3faef24abee0 100644
--- a/drivers/gpu/drm/openchrome/openchrome_clocks.c
+++ b/drivers/gpu/drm/openchrome/openchrome_clocks.c
@@ -66,8 +66,8 @@ u32 via_get_clk_value(struct drm_device *dev, u32 freq)
{ 0, 0, 0, 0, 0 } };
int count;
- if ((pdev->device != PCI_DEVICE_ID_VIA_CLE266)
- && (pdev->device != PCI_DEVICE_ID_VIA_KM400)) {
+ if ((pdev->device != PCI_DEVICE_ID_VIA_CLE266) &&
+ (pdev->device != PCI_DEVICE_ID_VIA_KM400)) {
/* DN[6:0] */
for (pll_n = 2; pll_n < 6; pll_n++) {
/* DR[2:0] */
@@ -126,7 +126,7 @@ u32 via_get_clk_value(struct drm_device *dev, u32 freq)
* The code was borrowed from OpenChrome DDX device driver UMS
* (User Mode Setting) section, but was modified to not use float type
* variables. */
- } else {
+ } else {
for (pll_r = 0; pll_r < 4; ++pll_r) {
for (pll_n = (pll_r == 0) ? 2 : 1; pll_n <= 7; ++pll_n) {
for (pll_m = 1; pll_m <= 127; ++pll_m) {
@@ -154,7 +154,7 @@ u32 via_get_clk_value(struct drm_device *dev, u32 freq)
/* Clock Synthesizer Value 0[7:6]: DR[1:0]
* Clock Synthesizer Value 0[5:0]: DN[5:0] */
pll_mrn = ((best_pll_r & 0x3) << 14 |
- (best_pll_n & 0x1F) << 8);
+ (best_pll_n & 0x1F) << 8);
/* Clock Synthesizer Value 1[6:0]: DM[6:0] */
pll_mrn |= (best_pll_m & 0x7F);
break;
@@ -166,12 +166,12 @@ u32 via_get_clk_value(struct drm_device *dev, u32 freq)
* Clock Synthesizer Value 1[4:2] : DR[2:0]
* Clock Synthesizer Value 1[7] : DTZ[0] */
pll_mrn |= (((PLL_DTZ_DEFAULT & 0x1) << 7) |
- ((best_pll_r & 0x7) << 2) |
- (((best_pll_m) >> 8) & 0x3)) << 8;
+ ((best_pll_r & 0x7) << 2) |
+ (((best_pll_m) >> 8) & 0x3)) << 8;
/* Clock Synthesizer Value 2[6:0] : DN[6:0]
* Clock Synthesizer Value 2[7] : DTZ[1] */
pll_mrn |= (((PLL_DTZ_DEFAULT >> 1) & 0x1) << 7) |
- ((best_pll_n) & 0x7F);
+ ((best_pll_n) & 0x7F);
break;
default:
/* Clock Synthesizer Value 0 : DM[7:0] */
@@ -180,12 +180,12 @@ u32 via_get_clk_value(struct drm_device *dev, u32 freq)
* Clock Synthesizer Value 1[4:2] : DR[2:0]
* Clock Synthesizer Value 1[7] : DTZ[0] */
pll_mrn |= (((PLL_DTZ_DEFAULT & 0x1) << 7) |
- ((best_pll_r & 0x7) << 2) |
- (((best_pll_m - 2) >> 8) & 0x3)) << 8;
+ ((best_pll_r & 0x7) << 2) |
+ (((best_pll_m - 2) >> 8) & 0x3)) << 8;
/* Clock Synthesizer Value 2[6:0] : DN[6:0]
* Clock Synthesizer Value 2[7] : DTZ[1] */
pll_mrn |= (((PLL_DTZ_DEFAULT >> 1) & 0x1) << 7) |
- ((best_pll_n - 2) & 0x7F);
+ ((best_pll_n - 2) & 0x7F);
break;
}
return pll_mrn;
@@ -206,7 +206,7 @@ void via_set_vclock(struct drm_crtc *crtc, u32 clk)
/* set clk */
if ((pdev->device == PCI_DEVICE_ID_VIA_CLE266) ||
- (pdev->device == PCI_DEVICE_ID_VIA_KM400)) {
+ (pdev->device == PCI_DEVICE_ID_VIA_KM400)) {
vga_wseq(VGABASE, 0x46, (clk & 0xFF00) >> 8); /* rshift + divisor */
vga_wseq(VGABASE, 0x47, (clk & 0x00FF)); /* multiplier */
} else {
@@ -233,7 +233,7 @@ void via_set_vclock(struct drm_crtc *crtc, u32 clk)
/* set clk */
if ((pdev->device == PCI_DEVICE_ID_VIA_CLE266) ||
- (pdev->device == PCI_DEVICE_ID_VIA_KM400)) {
+ (pdev->device == PCI_DEVICE_ID_VIA_KM400)) {
vga_wseq(VGABASE, 0x44, (clk & 0xFF00) >> 8);
vga_wseq(VGABASE, 0x45, (clk & 0x00FF));
} else {
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index f49c6cba6b4d..f0f0d6a8e8ef 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -421,7 +421,7 @@ static void via_fp_io_pad_setting(struct via_drm_priv *dev_priv,
via_fpdp_high_set_io_pad_state(VGABASE, io_pad_on ? 0x03 : 0x00);
break;
case (VIA_DI_PORT_FPDPLOW |
- VIA_DI_PORT_FPDPHIGH):
+ 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;
@@ -432,7 +432,7 @@ static void via_fp_io_pad_setting(struct via_drm_priv *dev_priv,
via_lvds2_set_io_pad_setting(VGABASE, io_pad_on ? 0x03 : 0x00);
break;
case (VIA_DI_PORT_LVDS1 |
- VIA_DI_PORT_LVDS2):
+ 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;
@@ -641,7 +641,7 @@ static bool via_lvds_mode_fixup(struct drm_encoder *encoder,
drm_object_property_get_value(&connector->base, prop, &scale_mode);
if ((mode->hdisplay != native_mode->hdisplay) ||
- (mode->vdisplay != native_mode->vdisplay)) {
+ (mode->vdisplay != native_mode->vdisplay)) {
if (scale_mode == DRM_MODE_SCALE_NONE)
return false;
drm_mode_copy(adjusted_mode, native_mode);
@@ -651,7 +651,7 @@ static bool via_lvds_mode_fixup(struct drm_encoder *encoder,
iga->scaling_mode = VIA_NO_SCALING;
/* Take care of 410 downscaling */
if ((mode->hdisplay > native_mode->hdisplay) ||
- (mode->vdisplay > native_mode->vdisplay)) {
+ (mode->vdisplay > native_mode->vdisplay)) {
iga->scaling_mode = VIA_SHRINK;
} else {
if (!iga->index || scale_mode == DRM_MODE_SCALE_CENTER) {
@@ -1029,8 +1029,8 @@ static int via_fp_mode_valid(struct drm_connector *connector,
drm_object_property_get_value(&connector->base, prop, &scale_mode);
if ((scale_mode == DRM_MODE_SCALE_NONE) &&
- ((mode->hdisplay != native_mode->hdisplay) ||
- (mode->vdisplay != native_mode->vdisplay)))
+ ((mode->hdisplay != native_mode->hdisplay) ||
+ (mode->vdisplay != native_mode->vdisplay)))
return MODE_PANEL;
/* Don't support mode larger than physical size */
@@ -1049,11 +1049,11 @@ static int via_fp_mode_valid(struct drm_connector *connector,
/* Now we can not support H V different scale */
if ((mode->hdisplay > native_mode->hdisplay) &&
- (mode->vdisplay < native_mode->vdisplay))
+ (mode->vdisplay < native_mode->vdisplay))
return MODE_PANEL;
if ((mode->hdisplay < native_mode->hdisplay) &&
- (mode->vdisplay > native_mode->vdisplay))
+ (mode->vdisplay > native_mode->vdisplay))
return MODE_PANEL;
}
return MODE_OK;
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index e7c801ffb13c..7a8e16662590 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -592,7 +592,7 @@ via_hdmi_detect(struct drm_connector *connector, bool force)
edid = via_hdmi_get_edid(connector);
if (edid) {
if ((connector->connector_type != DRM_MODE_CONNECTOR_HDMIA) ^
- (drm_detect_hdmi_monitor(edid)))
+ (drm_detect_hdmi_monitor(edid)))
ret = connector_status_connected;
}
return ret;
commit 6c39f33a2c80afcea6e38da244a3643cf55c94b7
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:46 2022 -0500
drm/openchrome: Fix struct declaration indentation
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_analog.c b/drivers/gpu/drm/openchrome/openchrome_analog.c
index 7c3766de7745..7237d311fa40 100644
--- a/drivers/gpu/drm/openchrome/openchrome_analog.c
+++ b/drivers/gpu/drm/openchrome/openchrome_analog.c
@@ -337,7 +337,8 @@ exit:
return count;
}
-static const struct drm_connector_helper_funcs via_analog_connector_helper_funcs = {
+static const struct drm_connector_helper_funcs
+via_analog_connector_helper_funcs = {
.mode_valid = via_connector_mode_valid,
.get_modes = via_analog_get_modes,
};
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 5c17bc89608e..a4014315319c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1828,8 +1828,8 @@ static void openchrome_crtc_helper_atomic_disable(struct drm_crtc *crtc,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static const struct
-drm_crtc_helper_funcs openchrome_drm_crtc_helper_funcs = {
+static const struct drm_crtc_helper_funcs
+openchrome_drm_crtc_helper_funcs = {
.mode_set_nofb = openchrome_mode_set_nofb,
.atomic_enable = openchrome_crtc_helper_atomic_enable,
.atomic_disable = openchrome_crtc_helper_atomic_disable,
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index bee69d406a8e..a1cdcb6e3411 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1208,8 +1208,8 @@ void openchrome_device_fini(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static const struct
-drm_mode_config_funcs openchrome_drm_mode_config_funcs = {
+static const struct drm_mode_config_funcs
+openchrome_drm_mode_config_funcs = {
.fb_create = drm_gem_fb_create,
.atomic_check = drm_atomic_helper_check,
.atomic_commit = drm_atomic_helper_commit,
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/openchrome_sii164.c
index 8fee343148de..112685feef97 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -329,7 +329,8 @@ exit:
}
-static const struct drm_encoder_helper_funcs openchrome_sii164_drm_encoder_helper_funcs = {
+static const struct drm_encoder_helper_funcs
+openchrome_sii164_drm_encoder_helper_funcs = {
.dpms = openchrome_sii164_dpms,
.mode_fixup = openchrome_sii164_mode_fixup,
.mode_set = openchrome_sii164_mode_set,
@@ -375,7 +376,8 @@ exit:
return ret;
}
-static const struct drm_connector_funcs openchrome_sii164_drm_connector_funcs = {
+static const struct drm_connector_funcs
+openchrome_sii164_drm_connector_funcs = {
.dpms = drm_helper_connector_dpms,
.detect = openchrome_sii164_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
@@ -480,7 +482,8 @@ exit:
return count;
}
-static const struct drm_connector_helper_funcs openchrome_sii164_drm_connector_helper_funcs = {
+static const struct drm_connector_helper_funcs
+openchrome_sii164_drm_connector_helper_funcs = {
.mode_valid = openchrome_sii164_mode_valid,
.get_modes = openchrome_sii164_get_modes,
};
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/openchrome_tmds.c
index 08b23d7a3661..ba65a3083c5c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -303,7 +303,7 @@ static void via_tmds_disable(struct drm_encoder *encoder)
}
static const struct drm_encoder_helper_funcs
- via_tmds_enc_helper_funcs = {
+via_tmds_enc_helper_funcs = {
.dpms = via_tmds_dpms,
.mode_fixup = via_tmds_mode_fixup,
.prepare = via_tmds_prepare,
@@ -392,7 +392,8 @@ static int via_tmds_get_modes(struct drm_connector *connector)
return count;
}
-static const struct drm_connector_helper_funcs via_dvi_connector_helper_funcs = {
+static const struct drm_connector_helper_funcs
+via_dvi_connector_helper_funcs = {
.mode_valid = via_connector_mode_valid,
.get_modes = via_tmds_get_modes,
};
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index cfb7f3d1b756..715158a6215e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -349,7 +349,8 @@ exit:
}
-static const struct drm_encoder_helper_funcs openchrome_vt1632_drm_encoder_helper_funcs = {
+static const struct drm_encoder_helper_funcs
+openchrome_vt1632_drm_encoder_helper_funcs = {
.dpms = openchrome_vt1632_dpms,
.mode_fixup = openchrome_vt1632_mode_fixup,
.mode_set = openchrome_vt1632_mode_set,
@@ -395,7 +396,8 @@ exit:
return ret;
}
-static const struct drm_connector_funcs openchrome_vt1632_drm_connector_funcs = {
+static const struct drm_connector_funcs
+openchrome_vt1632_drm_connector_funcs = {
.dpms = drm_helper_connector_dpms,
.detect = openchrome_vt1632_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
@@ -500,7 +502,8 @@ exit:
return count;
}
-static const struct drm_connector_helper_funcs openchrome_vt1632_drm_connector_helper_funcs = {
+static const struct drm_connector_helper_funcs
+openchrome_vt1632_drm_connector_helper_funcs = {
.mode_valid = openchrome_vt1632_mode_valid,
.get_modes = openchrome_vt1632_get_modes,
};
commit 4da5455ef2df471ec78e7bd1700a4b31f84dad8b
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:45 2022 -0500
drm/openchrome: Fix function declaration indentation
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_analog.c b/drivers/gpu/drm/openchrome/openchrome_analog.c
index dacf53d06da7..7c3766de7745 100644
--- a/drivers/gpu/drm/openchrome/openchrome_analog.c
+++ b/drivers/gpu/drm/openchrome/openchrome_analog.c
@@ -103,8 +103,7 @@ static const struct drm_encoder_funcs via_dac_enc_funcs = {
/*
* Manage the power state of analog (VGA) DAC.
*/
-static void
-via_analog_dpms(struct drm_encoder *encoder, int mode)
+static void via_analog_dpms(struct drm_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->dev;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -140,10 +139,9 @@ via_analog_dpms(struct drm_encoder *encoder, int mode)
* adjust it according to limitations or connector properties, and also
* a chance to reject the mode entirely. Useful for things like scaling.
*/
-static bool
-via_analog_mode_fixup(struct drm_encoder *encoder,
- const struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+static bool via_analog_mode_fixup(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
drm_mode_set_crtcinfo(adjusted_mode, 0);
return true;
@@ -152,10 +150,9 @@ via_analog_mode_fixup(struct drm_encoder *encoder,
/*
* Handle analog (VGA) mode setting.
*/
-static void
-via_analog_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+static void via_analog_mode_set(struct drm_encoder *encoder,
+ struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -169,8 +166,7 @@ via_analog_mode_set(struct drm_encoder *encoder,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void
-via_analog_prepare(struct drm_encoder *encoder)
+static void via_analog_prepare(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -185,8 +181,7 @@ via_analog_prepare(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void
-via_analog_commit(struct drm_encoder *encoder)
+static void via_analog_commit(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -201,8 +196,7 @@ via_analog_commit(struct drm_encoder *encoder)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void
-via_analog_disable(struct drm_encoder *encoder)
+static void via_analog_disable(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_clocks.c b/drivers/gpu/drm/openchrome/openchrome_clocks.c
index 91a732c70710..8bf2f48792c1 100644
--- a/drivers/gpu/drm/openchrome/openchrome_clocks.c
+++ b/drivers/gpu/drm/openchrome/openchrome_clocks.c
@@ -52,8 +52,7 @@ struct pll_mrn_value {
* [15:8 ] DR[2:0]
* [7 :0 ] DN[6:0]
*/
-u32
-via_get_clk_value(struct drm_device *dev, u32 freq)
+u32 via_get_clk_value(struct drm_device *dev, u32 freq)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
u32 best_pll_n = 2, best_pll_r = 0, best_pll_m = 2, best_clk_diff = freq;
@@ -193,8 +192,7 @@ via_get_clk_value(struct drm_device *dev, u32 freq)
}
/* Set VCLK */
-void
-via_set_vclock(struct drm_crtc *crtc, u32 clk)
+void via_set_vclock(struct drm_crtc *crtc, u32 clk)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 5a6562754e6f..5c17bc89608e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1102,8 +1102,7 @@ exit:
}
/* Load CRTC Pixel Timing registers */
-void
-via_load_crtc_pixel_timing(struct drm_crtc *crtc,
+void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
struct drm_display_mode *mode)
{
struct drm_device *dev = crtc->dev;
@@ -1179,8 +1178,7 @@ via_load_crtc_pixel_timing(struct drm_crtc *crtc,
}
/* Load CRTC timing registers */
-void
-via_load_crtc_timing(struct via_crtc *iga, struct drm_display_mode *mode)
+void via_load_crtc_timing(struct via_crtc *iga, struct drm_display_mode *mode)
{
struct drm_device *dev = iga->base.dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -1276,8 +1274,7 @@ via_load_crtc_timing(struct via_crtc *iga, struct drm_display_mode *mode)
* crtc : which IGA
* scale_type : upscaling(VIA_EXPAND) or downscaling(VIA_SHRINK)
*/
-void
-via_set_scale_path(struct drm_crtc *crtc, u32 scale_type)
+void via_set_scale_path(struct drm_crtc *crtc, u32 scale_type)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
@@ -1322,8 +1319,7 @@ via_set_scale_path(struct drm_crtc *crtc, u32 scale_type)
}
/* disable IGA scaling */
-static void
-via_disable_iga_scaling(struct drm_crtc *crtc)
+static void via_disable_iga_scaling(struct drm_crtc *crtc)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
@@ -1369,8 +1365,7 @@ via_disable_iga_scaling(struct drm_crtc *crtc)
* scale_type = VIA_HOR_EXPAND or VIA_VER_EXPAND or VIA_EXPAND or
* VIA_SHRINK or VIA_SHRINK + VIA_EXPAND
*/
-bool
-via_set_iga_scale_function(struct drm_crtc *crtc, u32 scale_type)
+bool via_set_iga_scale_function(struct drm_crtc *crtc, u32 scale_type)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
@@ -1531,10 +1526,9 @@ bool via_load_iga_scale_factor_regs(struct via_drm_priv *dev_priv,
return true;
}
-void
-via_set_iga2_downscale_source_timing(struct drm_crtc *crtc,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+void via_set_iga2_downscale_source_timing(struct drm_crtc *crtc,
+ struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
unsigned int viewx = adjusted_mode->hdisplay,
viewy = adjusted_mode->vdisplay;
@@ -1842,7 +1836,7 @@ drm_crtc_helper_funcs openchrome_drm_crtc_helper_funcs = {
};
static int openchrome_primary_atomic_check(struct drm_plane *plane,
- struct drm_atomic_state *state)
+ struct drm_atomic_state *state)
{
struct drm_plane_state *new_plane_state =
drm_atomic_get_new_plane_state(state, plane);
@@ -2240,8 +2234,7 @@ static const uint32_t openchrome_primary_formats[] = {
DRM_FORMAT_RGB332,
};
-int openchrome_crtc_init(struct via_drm_priv *dev_priv,
- uint32_t index)
+int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
{
struct drm_device *dev = &dev_priv->dev;
struct via_crtc *iga;
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index d5aca2bb9abf..52eba86d6b9a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -295,7 +295,7 @@ exit:
}
static void openchrome_cursor_cleanup_fb(struct drm_plane *plane,
- struct drm_plane_state *old_state)
+ struct drm_plane_state *old_state)
{
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
@@ -326,7 +326,7 @@ exit:
}
static int openchrome_cursor_atomic_check(struct drm_plane *plane,
- struct drm_atomic_state *state)
+ struct drm_atomic_state *state)
{
struct drm_plane_state *new_plane_state =
drm_atomic_get_new_plane_state(state, plane);
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 1e8aeea877c8..14edb2410af8 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -38,8 +38,7 @@ void via_encoder_cleanup(struct drm_encoder *encoder)
kfree(enc);
}
-int
-via_connector_mode_valid(struct drm_connector *connector,
+int via_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
/* Check Clock Range */
@@ -52,8 +51,7 @@ via_connector_mode_valid(struct drm_connector *connector,
return MODE_OK;
}
-void
-via_connector_destroy(struct drm_connector *connector)
+void via_connector_destroy(struct drm_connector *connector)
{
struct via_connector *con = container_of(connector, struct via_connector, base);
struct drm_property *property, *tmp;
@@ -87,8 +85,7 @@ static struct td_timer td_timer_regs[] = {
* Function Name: via_init_td_timing_regs
* Description: Init TD timing register (power sequence)
*/
-static void
-via_init_td_timing_regs(struct drm_device *dev)
+static void via_init_td_timing_regs(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -123,8 +120,7 @@ via_init_td_timing_regs(struct drm_device *dev)
}
}
-int
-via_modeset_init(struct drm_device *dev)
+int via_modeset_init(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index b2ec71a38f5d..1b75122c31eb 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -85,10 +85,9 @@ static void openchrome_driver_lastclose(struct drm_device *dev)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static int openchrome_driver_dumb_create(
- struct drm_file *file_priv,
- struct drm_device *dev,
- struct drm_mode_create_dumb *args)
+static int openchrome_driver_dumb_create(struct drm_file *file_priv,
+ struct drm_device *dev,
+ struct drm_mode_create_dumb *args)
{
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct openchrome_bo *bo;
@@ -129,11 +128,10 @@ exit:
return ret;
}
-static int openchrome_driver_dumb_map_offset(
- struct drm_file *file_priv,
- struct drm_device *dev,
- uint32_t handle,
- uint64_t *offset)
+static int openchrome_driver_dumb_map_offset(struct drm_file *file_priv,
+ struct drm_device *dev,
+ uint32_t handle,
+ uint64_t *offset)
{
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 969c2a4e1aab..50f6232de834 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -396,9 +396,8 @@ void openchrome_transmitter_clock_drive_strength(
void openchrome_transmitter_data_drive_strength(
struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength);
-void openchrome_transmitter_display_source(
- struct via_drm_priv *dev_priv,
- u32 di_port, int index);
+void openchrome_transmitter_display_source(struct via_drm_priv *dev_priv,
+ u32 di_port, int index);
extern const struct drm_plane_helper_funcs
openchrome_cursor_drm_plane_helper_funcs;
@@ -413,11 +412,11 @@ void via_modeset_fini(struct drm_device *dev);
/* i2c */
struct i2c_adapter *via_find_ddc_bus(int port);
void via_i2c_readbytes(struct i2c_adapter *adapter,
- u8 slave_addr, char offset,
- u8 *buffer, unsigned int size);
+ u8 slave_addr, char offset,
+ u8 *buffer, unsigned int size);
void via_i2c_writebytes(struct i2c_adapter *adapter,
- u8 slave_addr, char offset,
- u8 *data, unsigned int size);
+ u8 slave_addr, char offset,
+ u8 *data, unsigned int size);
void via_i2c_reg_init(struct via_drm_priv *dev_priv);
int via_i2c_init(struct drm_device *dev);
void via_i2c_exit(void);
@@ -428,9 +427,8 @@ void via_set_vclock(struct drm_crtc *crtc, u32 clk);
/* crtc */
void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
- struct drm_display_mode *mode);
-int openchrome_crtc_init(struct via_drm_priv *dev_priv,
- uint32_t index);
+ struct drm_display_mode *mode);
+int openchrome_crtc_init(struct via_drm_priv *dev_priv, uint32_t index);
/* encoders */
void via_encoder_cleanup(struct drm_encoder *encoder);
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index 4fb325637ef3..f49c6cba6b4d 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -98,9 +98,8 @@ exit:
}
/* caculate the cetering timing using mode and adjusted_mode */
-static void
-via_centering_timing(const struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+static void via_centering_timing(const struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
int panel_hsync_time = adjusted_mode->hsync_end -
adjusted_mode->hsync_start;
@@ -604,10 +603,9 @@ static void via_fp_dpms(struct drm_encoder *encoder, int mode)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static bool
-via_lvds_mode_fixup(struct drm_encoder *encoder,
- const struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+static bool via_lvds_mode_fixup(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
struct drm_property *prop = encoder->dev->mode_config.scaling_mode_property;
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
@@ -1012,9 +1010,8 @@ exit:
return count;
}
-static int
-via_fp_mode_valid(struct drm_connector *connector,
- struct drm_display_mode *mode)
+static int via_fp_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
{
struct drm_property *prop = connector->dev->mode_config.scaling_mode_property;
struct drm_display_mode *native_mode = NULL, *tmp, *t;
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index 3f2269da5ab7..e7c801ffb13c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -48,8 +48,7 @@ static const struct drm_encoder_funcs via_hdmi_enc_funcs = {
.destroy = via_encoder_cleanup,
};
-static void
-via_hdmi_enc_dpms(struct drm_encoder *encoder, int mode)
+static void via_hdmi_enc_dpms(struct drm_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->dev;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -74,10 +73,9 @@ via_hdmi_enc_dpms(struct drm_encoder *encoder, int mode)
}
}
-static bool
-via_hdmi_enc_mode_fixup(struct drm_encoder *encoder,
- const struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+static bool via_hdmi_enc_mode_fixup(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
uint32_t panelHSyncTime = 0, panelHBlankStart = 0, newHBlankStart = 0;
uint32_t panelVSyncTime = 0, panelVBlankStart = 0, newVBlankStart = 0;
@@ -157,9 +155,9 @@ via_hdmi_enc_mode_fixup(struct drm_encoder *encoder,
return true;
}
-static void
-via_hdmi_native_mode_set(struct via_crtc *iga, struct drm_display_mode *mode,
- bool audio_off)
+static void via_hdmi_native_mode_set(struct via_crtc *iga,
+ struct drm_display_mode *mode,
+ bool audio_off)
{
struct drm_device *dev = iga->base.dev;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -242,10 +240,9 @@ via_hdmi_native_mode_set(struct via_crtc *iga, struct drm_display_mode *mode,
svga_wcrt_mask(VGABASE, 0xFF, value, BIT(1) | BIT(0));
}
-static void
-via_hdmi_enc_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+static void via_hdmi_enc_mode_set(struct drm_encoder *encoder,
+ struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
@@ -488,8 +485,7 @@ unsigned int via_ddc_read_bytes_by_hdmi(struct via_drm_priv *dev_priv,
return status;
}
-struct edid *
-via_hdmi_get_edid(struct drm_connector *connector)
+struct edid* via_hdmi_get_edid(struct drm_connector *connector)
{
bool print_bad_edid = !connector->bad_edid_counter || (drm_debug_enabled(DRM_UT_KMS));
struct drm_device *dev = connector->dev;
@@ -602,10 +598,9 @@ via_hdmi_detect(struct drm_connector *connector, bool force)
return ret;
}
-static int
-via_hdmi_set_property(struct drm_connector *connector,
- struct drm_property *property,
- uint64_t value)
+static int via_hdmi_set_property(struct drm_connector *connector,
+ struct drm_property *property,
+ uint64_t value)
{
struct drm_device *dev = connector->dev;
@@ -627,15 +622,13 @@ static const struct drm_connector_funcs via_hdmi_connector_funcs = {
drm_atomic_helper_connector_destroy_state,
};
-static int
-via_hdmi_mode_valid(struct drm_connector *connector,
- struct drm_display_mode *mode)
+static int via_hdmi_mode_valid(struct drm_connector *connector,
+ struct drm_display_mode *mode)
{
return MODE_OK;
}
-int
-via_hdmi_get_modes(struct drm_connector *connector)
+int via_hdmi_get_modes(struct drm_connector *connector)
{
struct edid *edid = via_hdmi_get_edid(connector);
@@ -657,8 +650,7 @@ static const struct drm_connector_helper_funcs via_hdmi_connector_helper_funcs =
.get_modes = via_hdmi_get_modes,
};
-void
-via_hdmi_init(struct drm_device *dev, u32 di_port)
+void via_hdmi_init(struct drm_device *dev, u32 di_port)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_connector *dvi, *hdmi;
diff --git a/drivers/gpu/drm/openchrome/openchrome_i2c.c b/drivers/gpu/drm/openchrome/openchrome_i2c.c
index bae65db25cc4..319aaaa61f93 100644
--- a/drivers/gpu/drm/openchrome/openchrome_i2c.c
+++ b/drivers/gpu/drm/openchrome/openchrome_i2c.c
@@ -99,8 +99,8 @@ struct i2c_adapter *via_find_ddc_bus(int port)
return adapter;
}
-static int
-create_i2c_bus(struct drm_device *dev, struct via_i2c_stuff *i2c_par)
+static int create_i2c_bus(struct drm_device *dev,
+ struct via_i2c_stuff *i2c_par)
{
struct i2c_adapter *adapter = &i2c_par->adapter;
struct i2c_algo_bit_data *algo = &i2c_par->algo;
@@ -127,8 +127,7 @@ create_i2c_bus(struct drm_device *dev, struct via_i2c_stuff *i2c_par)
return i2c_bit_add_bus(adapter);
}
-void
-via_i2c_readbytes(struct i2c_adapter *adapter,
+void via_i2c_readbytes(struct i2c_adapter *adapter,
u8 slave_addr, char offset,
u8 *buffer, unsigned int size)
{
@@ -158,8 +157,7 @@ via_i2c_readbytes(struct i2c_adapter *adapter,
*buffer = in_buf[0];
}
-void
-via_i2c_writebytes(struct i2c_adapter *adapter,
+void via_i2c_writebytes(struct i2c_adapter *adapter,
u8 slave_addr, char offset,
u8 *data, unsigned int size)
{
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/openchrome_sii164.c
index 8ca745691eaa..8fee343148de 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -42,7 +42,8 @@
#define SII164_PDB BIT(0)
-static void openchrome_sii164_power(struct i2c_adapter *i2c_bus, bool power_state)
+static void openchrome_sii164_power(struct i2c_adapter *i2c_bus,
+ bool power_state)
{
u8 buf;
u8 power_bit;
@@ -80,8 +81,7 @@ static bool openchrome_sii164_sense(struct i2c_adapter *i2c_bus)
return rx_detected;
}
-static void openchrome_sii164_display_registers(
- struct i2c_adapter *i2c_bus)
+static void openchrome_sii164_display_registers(struct i2c_adapter *i2c_bus)
{
uint8_t i;
u8 buf;
@@ -97,8 +97,7 @@ static void openchrome_sii164_display_registers(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_sii164_init_registers(
- struct i2c_adapter *i2c_bus)
+static void openchrome_sii164_init_registers(struct i2c_adapter *i2c_bus)
{
u8 buf;
@@ -191,8 +190,8 @@ static bool openchrome_sii164_mode_fixup(struct drm_encoder *encoder,
}
static void openchrome_sii164_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
struct via_encoder *enc = container_of(encoder,
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/openchrome_tmds.c
index faac91aed175..08b23d7a3661 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -228,10 +228,9 @@ static void via_tmds_dpms(struct drm_encoder *encoder, int mode)
* adjust it according to limitations or connector properties, and also
* a chance to reject the mode entirely. Usefule for things like scaling.
*/
-static bool
-via_tmds_mode_fixup(struct drm_encoder *encoder,
- const struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+static bool via_tmds_mode_fixup(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
drm_mode_set_crtcinfo(adjusted_mode, 0);
return true;
@@ -270,10 +269,9 @@ static void via_tmds_commit(struct drm_encoder *encoder)
/*
* Handle CX700 / VX700 and VX800 integrated TMDS (DVI) mode setting.
*/
-static void
-via_tmds_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+static void via_tmds_mode_set(struct drm_encoder *encoder,
+ struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -314,8 +312,9 @@ static const struct drm_encoder_helper_funcs
.disable = via_tmds_disable,
};
-static enum drm_connector_status
-via_tmds_detect(struct drm_connector *connector, bool force)
+static enum drm_connector_status via_tmds_detect(
+ struct drm_connector *connector,
+ bool force)
{
struct via_connector *con = container_of(connector, struct via_connector, base);
enum drm_connector_status ret = connector_status_disconnected;
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index 12d806bb9abb..cfb7f3d1b756 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -42,7 +42,8 @@
#define VIA_VT1632_PDB BIT(0)
-static void openchrome_vt1632_power(struct i2c_adapter *i2c_bus, bool power_state)
+static void openchrome_vt1632_power(struct i2c_adapter *i2c_bus,
+ bool power_state)
{
u8 buf;
u8 power_bit;
@@ -80,8 +81,7 @@ static bool openchrome_vt1632_sense(struct i2c_adapter *i2c_bus)
return rx_detected;
}
-static void openchrome_vt1632_display_registers(
- struct i2c_adapter *i2c_bus)
+static void openchrome_vt1632_display_registers(struct i2c_adapter *i2c_bus)
{
uint8_t i;
u8 buf;
@@ -97,8 +97,7 @@ static void openchrome_vt1632_display_registers(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_vt1632_init_registers(
- struct i2c_adapter *i2c_bus)
+static void openchrome_vt1632_init_registers(struct i2c_adapter *i2c_bus)
{
u8 buf;
@@ -211,8 +210,8 @@ static bool openchrome_vt1632_mode_fixup(struct drm_encoder *encoder,
}
static void openchrome_vt1632_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode)
{
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
struct via_encoder *enc = container_of(encoder,
commit d5e9029a8b52da904ee6b116f5db4ad4c0450fb1
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:43 2022 -0500
drm/openchrome: Shorten dev_private pointer name to dev_priv
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_analog.c b/drivers/gpu/drm/openchrome/openchrome_analog.c
index a7346ed631fb..dacf53d06da7 100644
--- a/drivers/gpu/drm/openchrome/openchrome_analog.c
+++ b/drivers/gpu/drm/openchrome/openchrome_analog.c
@@ -36,7 +36,7 @@
/*
* Enables or disables analog (VGA) output.
*/
-static void via_analog_power(struct via_drm_priv *dev_private,
+static void via_analog_power(struct via_drm_priv *dev_priv,
bool outputState)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -52,7 +52,7 @@ static void via_analog_power(struct via_drm_priv *dev_private,
/*
* Set analog (VGA) sync polarity.
*/
-static void via_analog_sync_polarity(struct via_drm_priv *dev_private,
+static void via_analog_sync_polarity(struct via_drm_priv *dev_priv,
unsigned int flags)
{
u8 syncPolarity = 0x00;
@@ -79,7 +79,7 @@ static void via_analog_sync_polarity(struct via_drm_priv *dev_private,
/*
* Sets analog (VGA) display source.
*/
-static void via_analog_display_source(struct via_drm_priv *dev_private,
+static void via_analog_display_source(struct via_drm_priv *dev_priv,
int index)
{
u8 displaySource = index;
@@ -107,26 +107,26 @@ static void
via_analog_dpms(struct drm_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(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_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_ON);
- via_analog_power(dev_private, true);
+ via_analog_power(dev_priv, true);
break;
case DRM_MODE_DPMS_STANDBY:
via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_STANDBY);
- via_analog_power(dev_private, true);
+ via_analog_power(dev_priv, true);
break;
case DRM_MODE_DPMS_SUSPEND:
via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_SUSPEND);
- via_analog_power(dev_private, true);
+ via_analog_power(dev_priv, true);
break;
case DRM_MODE_DPMS_OFF:
via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_OFF);
- via_analog_power(dev_private, false);
+ via_analog_power(dev_priv, false);
break;
default:
DRM_ERROR("Bad DPMS mode.");
@@ -158,13 +158,13 @@ via_analog_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(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_analog_sync_polarity(dev_private, adjusted_mode->flags);
- via_analog_display_source(dev_private, iga->index);
+ via_analog_sync_polarity(dev_priv, adjusted_mode->flags);
+ via_analog_display_source(dev_priv, iga->index);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -173,13 +173,13 @@ static void
via_analog_prepare(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (encoder->crtc) {
via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_OFF);
- via_analog_power(dev_private, false);
+ via_analog_power(dev_priv, false);
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -189,13 +189,13 @@ static void
via_analog_commit(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (encoder->crtc) {
via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_ON);
- via_analog_power(dev_private, true);
+ via_analog_power(dev_priv, true);
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -205,12 +205,12 @@ static void
via_analog_disable(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_OFF);
- via_analog_power(dev_private, false);
+ via_analog_power(dev_priv, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -350,7 +350,7 @@ static const struct drm_connector_helper_funcs via_analog_connector_helper_funcs
void via_analog_probe(struct drm_device *dev)
{
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev);
u16 chipset = pdev->device;
u8 sr13, sr5a;
@@ -375,28 +375,28 @@ void via_analog_probe(struct drm_device *dev)
DRM_DEBUG_KMS("SR13: 0x%02x\n", sr13);
if (!(sr13 & BIT(2))) {
- dev_private->analog_presence = true;
+ dev_priv->analog_presence = true;
DRM_DEBUG_KMS("Detected the presence of VGA.\n");
} else {
- dev_private->analog_presence = false;
+ dev_priv->analog_presence = false;
}
/* Restore SR5A. */
vga_wseq(VGABASE, 0x5a, sr5a);
break;
default:
- dev_private->analog_presence = true;
+ dev_priv->analog_presence = true;
DRM_DEBUG_KMS("Detected the presence of VGA.\n");
break;
}
- dev_private->analog_i2c_bus = VIA_I2C_NONE;
+ dev_priv->analog_i2c_bus = VIA_I2C_NONE;
- if (dev_private->analog_presence) {
- dev_private->analog_i2c_bus = VIA_I2C_BUS2 | VIA_I2C_BUS1;
+ if (dev_priv->analog_presence) {
+ dev_priv->analog_i2c_bus = VIA_I2C_BUS2 | VIA_I2C_BUS1;
}
- dev_private->mapped_i2c_bus |= dev_private->analog_i2c_bus;
+ dev_priv->mapped_i2c_bus |= dev_priv->analog_i2c_bus;
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -405,7 +405,7 @@ void via_analog_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
enc = kzalloc(sizeof(*enc) + sizeof(*con), GFP_KERNEL);
if (!enc) {
@@ -421,7 +421,7 @@ void via_analog_init(struct drm_device *dev)
drm_connector_helper_add(&con->base, &via_analog_connector_helper_funcs);
drm_connector_register(&con->base);
- con->i2c_bus = dev_private->analog_i2c_bus;
+ con->i2c_bus = dev_priv->analog_i2c_bus;
con->base.doublescan_allowed = false;
con->base.interlace_allowed = true;
diff --git a/drivers/gpu/drm/openchrome/openchrome_clocks.c b/drivers/gpu/drm/openchrome/openchrome_clocks.c
index 2994232044ad..91a732c70710 100644
--- a/drivers/gpu/drm/openchrome/openchrome_clocks.c
+++ b/drivers/gpu/drm/openchrome/openchrome_clocks.c
@@ -199,7 +199,7 @@ via_set_vclock(struct drm_crtc *crtc, u32 clk)
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
unsigned long max_loop = 50, i = 0;
if (!iga->index) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 021671a70864..5a6562754e6f 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -95,7 +95,7 @@ static void via_iga_common_init(void __iomem *regs)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_iga1_set_color_depth(struct via_drm_priv *dev_private,
+static void via_iga1_set_color_depth(struct via_drm_priv *dev_priv,
u8 depth)
{
u8 value;
@@ -139,7 +139,7 @@ static void via_iga1_set_color_depth(struct via_drm_priv *dev_private,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_iga2_set_color_depth(struct via_drm_priv *dev_private,
+static void via_iga2_set_color_depth(struct via_drm_priv *dev_priv,
u8 depth)
{
u8 value;
@@ -185,7 +185,7 @@ static int openchrome_gamma_set(struct drm_crtc *crtc,
{
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
int end = (size > 256) ? 256 : size, i;
@@ -350,7 +350,7 @@ static const struct drm_crtc_funcs openchrome_drm_crtc_funcs = {
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
};
-static void via_load_vpit_regs(struct via_drm_priv *dev_private)
+static void via_load_vpit_regs(struct via_drm_priv *dev_priv)
{
u8 ar[] = {0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07,
@@ -386,7 +386,7 @@ static void via_load_vpit_regs(struct via_drm_priv *dev_private)
}
static int via_iga1_display_fifo_regs(struct drm_device *dev,
- struct via_drm_priv *dev_private,
+ struct via_drm_priv *dev_priv,
struct via_crtc *iga,
struct drm_display_mode *mode,
struct drm_framebuffer *fb)
@@ -404,7 +404,7 @@ static int via_iga1_display_fifo_regs(struct drm_device *dev,
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_CLE266:
- if (dev_private->revision == CLE266_REVISION_AX) {
+ if (dev_priv->revision == CLE266_REVISION_AX) {
if (mode->hdisplay > 1024) {
/* SR17[6:0] */
fifo_max_depth = 96;
@@ -429,7 +429,7 @@ static int via_iga1_display_fifo_regs(struct drm_device *dev,
enable_extended_display_fifo = false;
}
- if (dev_private->vram_type <= VIA_MEM_DDR_200) {
+ if (dev_priv->vram_type <= VIA_MEM_DDR_200) {
if (fb->format->depth == 24) {
if (mode->hdisplay > 1024) {
if (mode->vdisplay > 768) {
@@ -470,7 +470,7 @@ static int via_iga1_display_fifo_regs(struct drm_device *dev,
display_queue_expire_num = 124;
}
}
- /* dev_private->revision == CLE266_REVISION_CX */
+ /* dev_priv->revision == CLE266_REVISION_CX */
} else {
if (mode->hdisplay >= 1024) {
/* SR17[6:0] */
@@ -496,7 +496,7 @@ static int via_iga1_display_fifo_regs(struct drm_device *dev,
enable_extended_display_fifo = false;
}
- if (dev_private->vram_type <= VIA_MEM_DDR_200) {
+ if (dev_priv->vram_type <= VIA_MEM_DDR_200) {
if (mode->hdisplay > 1024) {
if (mode->vdisplay > 768) {
/* SR22[4:0] */
@@ -526,7 +526,7 @@ static int via_iga1_display_fifo_regs(struct drm_device *dev,
case PCI_DEVICE_ID_VIA_KM400:
if ((mode->hdisplay >= 1600) &&
- (dev_private->vram_type <= VIA_MEM_DDR_200)) {
+ (dev_priv->vram_type <= VIA_MEM_DDR_200)) {
/* SR17[6:0] */
fifo_max_depth = 58;
@@ -548,7 +548,7 @@ static int via_iga1_display_fifo_regs(struct drm_device *dev,
enable_extended_display_fifo = false;
- if (dev_private->vram_type <= VIA_MEM_DDR_200) {
+ if (dev_priv->vram_type <= VIA_MEM_DDR_200) {
if (mode->hdisplay >= 1600) {
/* SR22[4:0] */
display_queue_expire_num = 16;
@@ -788,7 +788,7 @@ exit:
}
static int via_iga2_display_fifo_regs(struct drm_device *dev,
- struct via_drm_priv *dev_private,
+ struct via_drm_priv *dev_priv,
struct via_crtc *iga,
struct drm_display_mode *mode,
struct drm_framebuffer *fb)
@@ -806,11 +806,11 @@ static int via_iga2_display_fifo_regs(struct drm_device *dev,
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_CLE266:
- if (dev_private->revision == CLE266_REVISION_AX) {
- if (((dev_private->vram_type <= VIA_MEM_DDR_200) &&
+ if (dev_priv->revision == CLE266_REVISION_AX) {
+ if (((dev_priv->vram_type <= VIA_MEM_DDR_200) &&
(fb->format->depth > 16) &&
(mode->vdisplay > 768)) ||
- ((dev_private->vram_type <= VIA_MEM_DDR_266) &&
+ ((dev_priv->vram_type <= VIA_MEM_DDR_266) &&
(fb->format->depth > 16) &&
(mode->hdisplay > 1280))) {
/* CR68[7:4] */
@@ -829,7 +829,7 @@ static int via_iga2_display_fifo_regs(struct drm_device *dev,
enable_extended_display_fifo = false;
}
- /* dev_private->revision == CLE266_REVISION_CX */
+ /* dev_priv->revision == CLE266_REVISION_CX */
} else {
if (mode->hdisplay >= 1024) {
/* CR68[7:4] */
@@ -862,10 +862,10 @@ static int via_iga2_display_fifo_regs(struct drm_device *dev,
enable_extended_display_fifo = true;
} else if (((mode->hdisplay > 1024) &&
(fb->format->depth == 24) &&
- (dev_private->vram_type <= VIA_MEM_DDR_333)) ||
+ (dev_priv->vram_type <= VIA_MEM_DDR_333)) ||
((mode->hdisplay == 1024) &&
(fb->format->depth == 24) &&
- (dev_private->vram_type <= VIA_MEM_DDR_200))) {
+ (dev_priv->vram_type <= VIA_MEM_DDR_200))) {
/* CR68[7:4] */
fifo_max_depth = 104;
@@ -875,10 +875,10 @@ static int via_iga2_display_fifo_regs(struct drm_device *dev,
enable_extended_display_fifo = true;
} else if (((mode->hdisplay > 1280) &&
(fb->format->depth == 16) &&
- (dev_private->vram_type <= VIA_MEM_DDR_333)) ||
+ (dev_priv->vram_type <= VIA_MEM_DDR_333)) ||
((mode->hdisplay == 1280) &&
(fb->format->depth == 16) &&
- (dev_private->vram_type <= VIA_MEM_DDR_200))) {
+ (dev_priv->vram_type <= VIA_MEM_DDR_200))) {
/* CR68[7:4] */
fifo_max_depth = 88;
@@ -1108,7 +1108,7 @@ via_load_crtc_pixel_timing(struct drm_crtc *crtc,
{
struct drm_device *dev = crtc->dev;
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
u32 reg_value = 0;
reg_value = IGA1_PIXELTIMING_HOR_TOTAL_FORMULA(mode->crtc_htotal);
@@ -1184,7 +1184,7 @@ via_load_crtc_timing(struct via_crtc *iga, struct drm_display_mode *mode)
{
struct drm_device *dev = iga->base.dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
u32 reg_value = 0;
if (!iga->index) {
@@ -1282,7 +1282,7 @@ via_set_scale_path(struct drm_crtc *crtc, u32 scale_type)
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
u8 reg_cr_fd = vga_rcrt(VGABASE, 0xFD);
if (!iga->index)
@@ -1327,7 +1327,7 @@ via_disable_iga_scaling(struct drm_crtc *crtc)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
if (iga->index) {
/* IGA2 scalings disable */
@@ -1374,7 +1374,7 @@ via_set_iga_scale_function(struct drm_crtc *crtc, u32 scale_type)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
if (!(scale_type & (VIA_SHRINK + VIA_EXPAND)))
return false;
@@ -1457,7 +1457,7 @@ via_set_iga_scale_function(struct drm_crtc *crtc, u32 scale_type)
* 2. load scale factors into registers
* 3. enable H or V scale ( set CRA2 bit7 or bit3 )
*/
-bool via_load_iga_scale_factor_regs(struct via_drm_priv *dev_private,
+bool via_load_iga_scale_factor_regs(struct via_drm_priv *dev_priv,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode,
u32 scale_type, u32 is_hor_or_ver)
@@ -1591,7 +1591,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
&crtc->state->adjusted_mode;
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
u8 reg_value = 0;
int ret;
@@ -1599,7 +1599,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
if (!iga->index) {
/* Load standard registers */
- via_load_vpit_regs(dev_private);
+ via_load_vpit_regs(dev_priv);
/* Unlock */
via_unlock_crtc(VGABASE, pdev->device);
@@ -1647,7 +1647,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
via_iga1_set_hsync_shift(VGABASE, 0x05);
/* Load display FIFO. */
- ret = via_iga1_display_fifo_regs(dev, dev_private,
+ ret = via_iga1_display_fifo_regs(dev, dev_priv,
iga, adjusted_mode,
crtc->primary->fb);
if (ret) {
@@ -1671,7 +1671,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
via_iga1_set_palette_lut_resolution(VGABASE, true);
} else {
/* Load standard registers */
- via_load_vpit_regs(dev_private);
+ via_load_vpit_regs(dev_priv);
/* Unlock */
via_unlock_crtc(VGABASE, pdev->device);
@@ -1694,7 +1694,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
* here, because crtc_vdisplay=540,
* vdisplay=1080, we need 540 here, not 1080.
*/
- via_load_iga_scale_factor_regs(dev_private,
+ via_load_iga_scale_factor_regs(dev_priv,
mode,
adjusted_mode,
VIA_SHRINK,
@@ -1734,7 +1734,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
crtc,
VIA_HOR_EXPAND);
via_load_iga_scale_factor_regs(
- dev_private,
+ dev_priv,
mode,
adjusted_mode,
VIA_EXPAND,
@@ -1748,7 +1748,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
crtc,
VIA_VER_EXPAND);
via_load_iga_scale_factor_regs(
- dev_private,
+ dev_priv,
mode,
adjusted_mode,
VIA_EXPAND,
@@ -1766,7 +1766,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
DRM_MODE_FLAG_INTERLACE);
/* Load display FIFO. */
- ret = via_iga2_display_fifo_regs(dev, dev_private,
+ ret = via_iga2_display_fifo_regs(dev, dev_priv,
iga, adjusted_mode,
crtc->primary->fb);
if (ret) {
@@ -1800,7 +1800,7 @@ static void openchrome_crtc_helper_atomic_enable(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{
struct drm_device *dev = crtc->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -1819,7 +1819,7 @@ static void openchrome_crtc_helper_atomic_disable(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{
struct drm_device *dev = crtc->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -1849,7 +1849,7 @@ static int openchrome_primary_atomic_check(struct drm_plane *plane,
struct drm_crtc_state *new_crtc_state;
struct drm_device *dev = plane->dev;
struct drm_framebuffer *fb = new_plane_state->fb;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
uint32_t frame_buffer_size;
int ret = 0;
@@ -1861,7 +1861,7 @@ static int openchrome_primary_atomic_check(struct drm_plane *plane,
frame_buffer_size = (fb->width * fb->format->cpp[0]) *
fb->height;
- if (frame_buffer_size > dev_private->vram_size) {
+ if (frame_buffer_size > dev_priv->vram_size) {
ret = -ENOMEM;
goto exit;
}
@@ -1906,7 +1906,7 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
uint32_t addr;
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
struct openchrome_bo *bo;
@@ -1918,7 +1918,7 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
if (!iga->index) {
- via_iga1_set_color_depth(dev_private, fb->format->depth);
+ via_iga1_set_color_depth(dev_priv, fb->format->depth);
/* Set the framebuffer offset */
addr = round_up((bo->ttm_bo.resource->start << PAGE_SHIFT) +
@@ -1942,7 +1942,7 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
* second adapter */
load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
} else {
- via_iga2_set_color_depth(dev_private, fb->format->depth);
+ via_iga2_set_color_depth(dev_priv, fb->format->depth);
/* Set the framebuffer offset */
addr = round_up((bo->ttm_bo.resource->start << PAGE_SHIFT) +
@@ -2046,11 +2046,11 @@ static const struct drm_plane_funcs openchrome_primary_drm_plane_funcs = {
drm_atomic_helper_plane_destroy_state,
};
-static void openchrome_crtc_param_init(struct via_drm_priv *dev_private,
+static void openchrome_crtc_param_init(struct via_drm_priv *dev_priv,
struct drm_crtc *crtc,
uint32_t index)
{
- struct drm_device *dev = &dev_private->dev;
+ struct drm_device *dev = &dev_priv->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -2240,10 +2240,10 @@ static const uint32_t openchrome_primary_formats[] = {
DRM_FORMAT_RGB332,
};
-int openchrome_crtc_init(struct via_drm_priv *dev_private,
+int openchrome_crtc_init(struct via_drm_priv *dev_priv,
uint32_t index)
{
- struct drm_device *dev = &dev_private->dev;
+ struct drm_device *dev = &dev_priv->dev;
struct via_crtc *iga;
struct drm_plane *primary;
struct drm_plane *cursor;
@@ -2312,7 +2312,7 @@ int openchrome_crtc_init(struct via_drm_priv *dev_private,
iga->index = index;
- openchrome_crtc_param_init(dev_private, &iga->base, index);
+ openchrome_crtc_param_init(dev_priv, &iga->base, index);
ret = openchrome_gamma_init(&iga->base);
if (ret) {
goto free_crtc;
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index 99b815c4464f..d5aca2bb9abf 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -57,7 +57,7 @@ static void openchrome_hide_cursor(struct drm_crtc *crtc)
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
uint32_t temp;
switch (pdev->device) {
@@ -89,7 +89,7 @@ static void openchrome_show_cursor(struct drm_crtc *crtc)
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_VT3157:
@@ -166,7 +166,7 @@ static void openchrome_cursor_address(struct drm_crtc *crtc,
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_VT3157:
@@ -206,7 +206,7 @@ static void openchrome_set_hi_location(struct drm_crtc *crtc,
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
uint32_t location_x = 0, location_y = 0;
uint32_t offset_x = 0, offset_y = 0;
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index f111df644424..1e8aeea877c8 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -91,7 +91,7 @@ static void
via_init_td_timing_regs(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
unsigned int td_timer[4] = { 500, 50, 0, 510 }, i;
struct vga_registers timings;
u32 reg_value;
@@ -127,20 +127,20 @@ int
via_modeset_init(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
uint32_t i;
int ret = 0;
- openchrome_mode_config_init(dev_private);
+ openchrome_mode_config_init(dev_priv);
/* Initialize the number of display connectors. */
- dev_private->number_fp = 0;
- dev_private->number_dvi = 0;
+ dev_priv->number_fp = 0;
+ dev_priv->number_dvi = 0;
/* Init TD timing register (power sequence) */
via_init_td_timing_regs(dev);
- via_i2c_reg_init(dev_private);
+ via_i2c_reg_init(dev_priv);
ret = via_i2c_init(dev);
if (ret) {
DRM_ERROR("Failed to initialize I2C bus!\n");
@@ -148,7 +148,7 @@ via_modeset_init(struct drm_device *dev)
}
for (i = 0; i < OPENCHROME_MAX_CRTC; i++) {
- ret = openchrome_crtc_init(dev_private, i);
+ ret = openchrome_crtc_init(dev_priv, i);
if (ret) {
goto exit;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index ef37a84025bf..b2ec71a38f5d 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -90,7 +90,7 @@ static int openchrome_driver_dumb_create(
struct drm_device *dev,
struct drm_mode_create_dumb *args)
{
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct openchrome_bo *bo;
uint32_t handle, pitch;
uint64_t size;
@@ -105,7 +105,7 @@ static int openchrome_driver_dumb_create(
size = pitch * args->height;
ret = openchrome_bo_create(dev,
- &dev_private->bdev,
+ &dev_priv->bdev,
size,
ttm_bo_type_device,
TTM_PL_VRAM,
@@ -199,7 +199,7 @@ static int openchrome_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct drm_device *dev;
- struct via_drm_priv *dev_private;
+ struct via_drm_priv *dev_priv;
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -215,16 +215,16 @@ static int openchrome_pci_probe(struct pci_dev *pdev,
goto exit;
}
- dev_private = devm_drm_dev_alloc(&pdev->dev,
+ dev_priv = devm_drm_dev_alloc(&pdev->dev,
&openchrome_driver,
struct via_drm_priv,
dev);
- if (IS_ERR(dev_private)) {
- ret = PTR_ERR(dev_private);
+ if (IS_ERR(dev_priv)) {
+ ret = PTR_ERR(dev_priv);
goto exit;
}
- dev = &dev_private->dev;
+ dev = &dev_priv->dev;
pci_set_drvdata(pdev, dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index ed246320bcbc..969c2a4e1aab 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -319,7 +319,7 @@ struct via_drm_priv {
/* VIA MMIO register access */
-#define VIA_BASE ((dev_private->mmio))
+#define VIA_BASE ((dev_priv->mmio))
#define VIA_READ(reg) ioread32(VIA_BASE + reg)
#define VIA_WRITE(reg, val) iowrite32(val, VIA_BASE + reg)
@@ -355,16 +355,16 @@ extern int openchrome_driver_num_ioctls;
extern struct ttm_device_funcs openchrome_bo_driver;
-int openchrome_vram_detect(struct via_drm_priv *dev_private);
-int openchrome_vram_init(struct via_drm_priv *dev_private);
-void openchrome_vram_fini(struct via_drm_priv *dev_private);
-int openchrome_mmio_init(struct via_drm_priv *dev_private);
-void openchrome_mmio_fini(struct via_drm_priv *dev_private);
-void openchrome_graphics_unlock(struct via_drm_priv *dev_private);
-void chip_revision_info(struct via_drm_priv *dev_private);
-int openchrome_device_init(struct via_drm_priv *dev_private);
-void openchrome_device_fini(struct via_drm_priv *dev_private);
-void openchrome_mode_config_init(struct via_drm_priv *dev_private);
+int openchrome_vram_detect(struct via_drm_priv *dev_priv);
+int openchrome_vram_init(struct via_drm_priv *dev_priv);
+void openchrome_vram_fini(struct via_drm_priv *dev_priv);
+int openchrome_mmio_init(struct via_drm_priv *dev_priv);
+void openchrome_mmio_fini(struct via_drm_priv *dev_priv);
+void openchrome_graphics_unlock(struct via_drm_priv *dev_priv);
+void chip_revision_info(struct via_drm_priv *dev_priv);
+int openchrome_device_init(struct via_drm_priv *dev_priv);
+void openchrome_device_fini(struct via_drm_priv *dev_priv);
+void openchrome_mode_config_init(struct via_drm_priv *dev_priv);
int openchrome_drm_init(struct drm_device *dev);
void openchrome_drm_fini(struct drm_device *dev);
@@ -384,20 +384,20 @@ int openchrome_bo_create(struct drm_device *dev,
bool kmap,
struct openchrome_bo **bo_ptr);
void openchrome_bo_destroy(struct openchrome_bo *bo, bool kmap);
-int openchrome_mm_init(struct via_drm_priv *dev_private);
-void openchrome_mm_fini(struct via_drm_priv *dev_private);
+int openchrome_mm_init(struct via_drm_priv *dev_priv);
+void openchrome_mm_fini(struct via_drm_priv *dev_priv);
-void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_private,
+void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
uint32_t di_port,
bool io_pad_on);
void openchrome_transmitter_clock_drive_strength(
- struct via_drm_priv *dev_private,
+ struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength);
void openchrome_transmitter_data_drive_strength(
- struct via_drm_priv *dev_private,
+ struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength);
void openchrome_transmitter_display_source(
- struct via_drm_priv *dev_private,
+ struct via_drm_priv *dev_priv,
u32 di_port, int index);
extern const struct drm_plane_helper_funcs
@@ -418,7 +418,7 @@ void via_i2c_readbytes(struct i2c_adapter *adapter,
void via_i2c_writebytes(struct i2c_adapter *adapter,
u8 slave_addr, char offset,
u8 *data, unsigned int size);
-void via_i2c_reg_init(struct via_drm_priv *dev_private);
+void via_i2c_reg_init(struct via_drm_priv *dev_priv);
int via_i2c_init(struct drm_device *dev);
void via_i2c_exit(void);
@@ -429,7 +429,7 @@ void via_set_vclock(struct drm_crtc *crtc, u32 clk);
/* crtc */
void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
struct drm_display_mode *mode);
-int openchrome_crtc_init(struct via_drm_priv *dev_private,
+int openchrome_crtc_init(struct via_drm_priv *dev_priv,
uint32_t index);
/* encoders */
diff --git a/drivers/gpu/drm/openchrome/openchrome_encoder.c b/drivers/gpu/drm/openchrome/openchrome_encoder.c
index eae49c72cffa..6c05f0da00cb 100644
--- a/drivers/gpu/drm/openchrome/openchrome_encoder.c
+++ b/drivers/gpu/drm/openchrome/openchrome_encoder.c
@@ -33,7 +33,7 @@
#include "openchrome_drv.h"
-void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_private,
+void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_priv,
uint32_t di_port,
bool io_pad_on)
{
@@ -86,7 +86,7 @@ void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_private,
}
void openchrome_transmitter_clock_drive_strength(
- struct via_drm_priv *dev_private,
+ struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -108,7 +108,7 @@ void openchrome_transmitter_clock_drive_strength(
}
void openchrome_transmitter_data_drive_strength(
- struct via_drm_priv *dev_private,
+ struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -129,7 +129,7 @@ void openchrome_transmitter_data_drive_strength(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_transmitter_display_source(struct via_drm_priv *dev_private,
+void openchrome_transmitter_display_source(struct via_drm_priv *dev_priv,
u32 di_port, int index)
{
u8 display_source = index & 0x01;
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index a9e396d3569d..4fb325637ef3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -136,9 +136,8 @@ via_centering_timing(const struct drm_display_mode *mode,
adjusted_mode->crtc_vsync_end = adjusted_mode->vsync_end;
}
-static void via_fp_castle_rock_soft_power_seq(
- struct via_drm_priv *dev_private,
- bool power_state)
+static void via_fp_castle_rock_soft_power_seq(struct via_drm_priv *dev_priv,
+ bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -189,7 +188,7 @@ static void via_fp_castle_rock_soft_power_seq(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_primary_soft_power_seq(struct via_drm_priv *dev_private,
+static void via_fp_primary_soft_power_seq(struct via_drm_priv *dev_priv,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -256,7 +255,7 @@ static void via_fp_primary_soft_power_seq(struct via_drm_priv *dev_private,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_secondary_soft_power_seq(struct via_drm_priv *dev_private,
+static void via_fp_secondary_soft_power_seq(struct via_drm_priv *dev_priv,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -323,7 +322,7 @@ static void via_fp_secondary_soft_power_seq(struct via_drm_priv *dev_private,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_primary_hard_power_seq(struct via_drm_priv *dev_private,
+static void via_fp_primary_hard_power_seq(struct via_drm_priv *dev_priv,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -354,7 +353,7 @@ static void via_fp_primary_hard_power_seq(struct via_drm_priv *dev_private,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_power(struct via_drm_priv *dev_private,
+static void via_fp_power(struct via_drm_priv *dev_priv,
unsigned short device,
u32 di_port, bool power_state)
{
@@ -362,8 +361,7 @@ static void via_fp_power(struct via_drm_priv *dev_private,
switch (device) {
case PCI_DEVICE_ID_VIA_CLE266:
- via_fp_castle_rock_soft_power_seq(dev_private,
- power_state);
+ via_fp_castle_rock_soft_power_seq(dev_priv, power_state);
break;
case PCI_DEVICE_ID_VIA_KM400:
case PCI_DEVICE_ID_VIA_CN700:
@@ -372,27 +370,24 @@ static void via_fp_power(struct via_drm_priv *dev_private,
case PCI_DEVICE_ID_VIA_VT3343:
case PCI_DEVICE_ID_VIA_K8M890:
case PCI_DEVICE_ID_VIA_P4M900:
- via_fp_primary_hard_power_seq(dev_private, power_state);
+ via_fp_primary_hard_power_seq(dev_priv, power_state);
break;
case PCI_DEVICE_ID_VIA_VT3157:
case PCI_DEVICE_ID_VIA_VT1122:
if (di_port & VIA_DI_PORT_LVDS1) {
- via_fp_primary_soft_power_seq(dev_private,
- power_state);
+ via_fp_primary_soft_power_seq(dev_priv, power_state);
via_lvds1_set_power(VGABASE, power_state);
}
if (di_port & VIA_DI_PORT_LVDS2) {
- via_fp_secondary_soft_power_seq(dev_private,
- power_state);
+ via_fp_secondary_soft_power_seq(dev_priv, power_state);
via_lvds2_set_power(VGABASE, power_state);
}
break;
case PCI_DEVICE_ID_VIA_VX875:
case PCI_DEVICE_ID_VIA_VX900_VGA:
- via_fp_primary_hard_power_seq(dev_private,
- power_state);
+ via_fp_primary_hard_power_seq(dev_priv, power_state);
via_lvds1_set_power(VGABASE, power_state);
break;
default:
@@ -408,7 +403,7 @@ static void via_fp_power(struct via_drm_priv *dev_private,
/*
* Sets flat panel I/O pad state.
*/
-static void via_fp_io_pad_setting(struct via_drm_priv *dev_private,
+static void via_fp_io_pad_setting(struct via_drm_priv *dev_priv,
u32 di_port, bool io_pad_on)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -451,7 +446,7 @@ static void via_fp_io_pad_setting(struct via_drm_priv *dev_private,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_format(struct via_drm_priv *dev_private,
+static void via_fp_format(struct via_drm_priv *dev_priv,
u32 di_port, u8 format)
{
u8 temp = format & 0x01;
@@ -477,7 +472,7 @@ static void via_fp_format(struct via_drm_priv *dev_private,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_output_format(struct via_drm_priv *dev_private,
+static void via_fp_output_format(struct via_drm_priv *dev_priv,
u32 di_port, u8 output_format)
{
u8 temp = output_format & 0x01;
@@ -503,7 +498,7 @@ static void via_fp_output_format(struct via_drm_priv *dev_private,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_dithering(struct via_drm_priv *dev_private,
+static void via_fp_dithering(struct via_drm_priv *dev_priv,
u32 di_port, bool dithering)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -530,7 +525,7 @@ static void via_fp_dithering(struct via_drm_priv *dev_private,
/*
* Sets flat panel display source.
*/
-static void via_fp_display_source(struct via_drm_priv *dev_private,
+static void via_fp_display_source(struct via_drm_priv *dev_priv,
u32 di_port, int index)
{
u8 display_source = index & 0x01;
@@ -584,7 +579,7 @@ static void via_fp_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -593,14 +588,14 @@ static void via_fp_dpms(struct drm_encoder *encoder, int mode)
switch (mode) {
case DRM_MODE_DPMS_ON:
- via_fp_power(dev_private, chipset, enc->di_port, true);
- via_fp_io_pad_setting(dev_private, enc->di_port, true);
+ via_fp_power(dev_priv, chipset, enc->di_port, true);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, true);
break;
case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_OFF:
- via_fp_power(dev_private, chipset, enc->di_port, false);
- via_fp_io_pad_setting(dev_private, enc->di_port, false);
+ via_fp_power(dev_priv, chipset, enc->di_port, false);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, false);
break;
default:
break;
@@ -680,15 +675,15 @@ static void via_fp_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_fp_power(dev_private, chipset, enc->di_port, false);
- via_fp_io_pad_setting(dev_private, enc->di_port, false);
+ via_fp_power(dev_priv, chipset, enc->di_port, false);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -699,15 +694,15 @@ static void via_fp_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_fp_power(dev_private, chipset, enc->di_port, true);
- via_fp_io_pad_setting(dev_private, enc->di_port, true);
+ via_fp_power(dev_priv, chipset, enc->di_port, true);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, true);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -720,7 +715,7 @@ via_fp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *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);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -742,19 +737,19 @@ via_fp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
case PCI_DEVICE_ID_VIA_VX875:
case PCI_DEVICE_ID_VIA_VX900_VGA:
/* OPENLDI Mode */
- via_fp_format(dev_private, enc->di_port, 0x01);
+ via_fp_format(dev_priv, enc->di_port, 0x01);
/* Sequential Mode */
- via_fp_output_format(dev_private, enc->di_port, 0x01);
+ via_fp_output_format(dev_priv, enc->di_port, 0x01);
/* Turn on dithering. */
- via_fp_dithering(dev_private, enc->di_port, true);
+ via_fp_dithering(dev_priv, enc->di_port, true);
break;
default:
break;
}
- via_fp_display_source(dev_private, enc->di_port, iga->index);
+ via_fp_display_source(dev_priv, enc->di_port, iga->index);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -765,15 +760,15 @@ static void via_fp_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_fp_power(dev_private, chipset, enc->di_port, false);
- via_fp_io_pad_setting(dev_private, enc->di_port, false);
+ via_fp_power(dev_priv, chipset, enc->di_port, false);
+ via_fp_io_pad_setting(dev_priv, enc->di_port, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -798,7 +793,7 @@ via_fp_detect(struct drm_connector *connector, bool force)
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_connector *con = container_of(connector,
struct via_connector, base);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
enum drm_connector_status ret = connector_status_disconnected;
struct i2c_adapter *i2c_bus;
struct edid *edid = NULL;
@@ -924,7 +919,7 @@ via_fp_get_modes(struct drm_connector *connector)
{
struct via_connector *con = container_of(connector, struct via_connector, base);
struct drm_device *dev = connector->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
struct edid *edid = NULL;
struct drm_display_mode *native_mode = NULL;
@@ -1077,7 +1072,7 @@ struct drm_connector_helper_funcs via_fp_connector_helper_funcs = {
void via_fp_probe(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct drm_connector connector;
struct i2c_adapter *i2c_bus;
struct edid *edid;
@@ -1100,15 +1095,15 @@ void via_fp_probe(struct drm_device *dev)
switch (chipset) {
case PCI_DEVICE_ID_VIA_CLE266:
if ((sr12 & BIT(4)) || (cr3b & BIT(3))) {
- dev_private->int_fp1_presence = true;
- dev_private->int_fp1_di_port = VIA_DI_PORT_DIP0;
+ dev_priv->int_fp1_presence = true;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_DIP0;
} else {
- dev_private->int_fp1_presence = false;
- dev_private->int_fp1_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp1_presence = false;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_NONE;
}
- dev_private->int_fp2_presence = false;
- dev_private->int_fp2_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = false;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_NONE;
break;
case PCI_DEVICE_ID_VIA_KM400:
case PCI_DEVICE_ID_VIA_CN700:
@@ -1119,17 +1114,16 @@ void via_fp_probe(struct drm_device *dev)
* 1: AGP pins are used by FPDP
* (Flat Panel Display Port) */
if ((sr13 & BIT(3)) && (cr3b & BIT(1))) {
- dev_private->int_fp1_presence = true;
- dev_private->int_fp1_di_port =
- VIA_DI_PORT_FPDPHIGH |
- VIA_DI_PORT_FPDPLOW;
+ dev_priv->int_fp1_presence = true;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_FPDPHIGH |
+ VIA_DI_PORT_FPDPLOW;
} else {
- dev_private->int_fp1_presence = false;
- dev_private->int_fp1_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp1_presence = false;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_NONE;
}
- dev_private->int_fp2_presence = false;
- dev_private->int_fp2_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = false;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_NONE;
break;
case PCI_DEVICE_ID_VIA_VT3343:
case PCI_DEVICE_ID_VIA_K8M890:
@@ -1141,22 +1135,21 @@ void via_fp_probe(struct drm_device *dev)
* 1: 24-bit FPDP (Flat Panel
* Display Port) */
if (sr12 & BIT(4)) {
- dev_private->int_fp1_presence = true;
- dev_private->int_fp1_di_port =
- VIA_DI_PORT_FPDPLOW |
- VIA_DI_PORT_FPDPHIGH;
+ dev_priv->int_fp1_presence = true;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_FPDPLOW |
+ VIA_DI_PORT_FPDPHIGH;
} else {
- dev_private->int_fp1_presence = true;
- dev_private->int_fp1_di_port =
+ dev_priv->int_fp1_presence = true;
+ dev_priv->int_fp1_di_port =
VIA_DI_PORT_FPDPLOW;
}
} else {
- dev_private->int_fp1_presence = false;
- dev_private->int_fp1_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp1_presence = false;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_NONE;
}
- dev_private->int_fp2_presence = false;
- dev_private->int_fp2_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = false;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_NONE;
break;
case PCI_DEVICE_ID_VIA_VT3157:
case PCI_DEVICE_ID_VIA_VT1122:
@@ -1174,29 +1167,23 @@ void via_fp_probe(struct drm_device *dev)
sr13 = vga_rseq(VGABASE, 0x13);
if (cr3b & BIT(1)) {
- if (dev_private->is_via_nanobook) {
- dev_private->int_fp1_presence = false;
- dev_private->int_fp1_di_port =
- VIA_DI_PORT_NONE;
- dev_private->int_fp2_presence = true;
- dev_private->int_fp2_di_port =
- VIA_DI_PORT_LVDS2;
- } else if (dev_private->is_quanta_il1) {
+ if (dev_priv->is_via_nanobook) {
+ dev_priv->int_fp1_presence = false;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = true;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_LVDS2;
+ } else if (dev_priv->is_quanta_il1) {
/* From the Quanta IL1 schematic. */
- dev_private->int_fp1_presence = true;
- dev_private->int_fp1_di_port =
- VIA_DI_PORT_DVP1;
- dev_private->int_fp2_presence = false;
- dev_private->int_fp2_di_port =
- VIA_DI_PORT_NONE;
-
- } else if (dev_private->is_samsung_nc20) {
- dev_private->int_fp1_presence = false;
- dev_private->int_fp1_di_port =
- VIA_DI_PORT_NONE;
- dev_private->int_fp2_presence = true;
- dev_private->int_fp2_di_port =
- VIA_DI_PORT_LVDS2;
+ dev_priv->int_fp1_presence = true;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_DVP1;
+ dev_priv->int_fp2_presence = false;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_NONE;
+
+ } else if (dev_priv->is_samsung_nc20) {
+ dev_priv->int_fp1_presence = false;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = true;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_LVDS2;
/* 3C5.13[7:6] - Integrated LVDS / DVI
* Mode Select (DVP1D15-14 pin
@@ -1209,62 +1196,54 @@ void via_fp_probe(struct drm_device *dev)
* the clock jitter) */
} else if ((!(sr13 & BIT(7))) &&
(!(sr13 & BIT(6)))) {
- dev_private->int_fp1_presence = true;
- dev_private->int_fp1_di_port =
- VIA_DI_PORT_LVDS1;
+ dev_priv->int_fp1_presence = true;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_LVDS1;
/*
* For now, don't support the second
* FP.
*/
- dev_private->int_fp2_presence = false;
- dev_private->int_fp2_di_port =
- VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = false;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_NONE;
} else if ((!(sr13 & BIT(7))) &&
(sr13 & BIT(6))) {
- dev_private->int_fp1_presence = false;
- dev_private->int_fp1_di_port =
- VIA_DI_PORT_NONE;
- dev_private->int_fp2_presence = true;
- dev_private->int_fp2_di_port =
- VIA_DI_PORT_LVDS2;
+ dev_priv->int_fp1_presence = false;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = true;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_LVDS2;
} else if ((sr13 & BIT(7)) &&
(!(sr13 & BIT(6)))) {
- dev_private->int_fp1_presence = true;
- dev_private->int_fp1_di_port =
- VIA_DI_PORT_LVDS1 |
- VIA_DI_PORT_LVDS2;
- dev_private->int_fp2_presence = false;
- dev_private->int_fp2_di_port =
- VIA_DI_PORT_NONE;
+ dev_priv->int_fp1_presence = true;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_LVDS1 |
+ VIA_DI_PORT_LVDS2;
+ dev_priv->int_fp2_presence = false;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_NONE;
} else {
- dev_private->int_fp1_presence = false;
- dev_private->int_fp1_di_port =
- VIA_DI_PORT_NONE;
- dev_private->int_fp2_presence = false;
- dev_private->int_fp2_di_port =
- VIA_DI_PORT_NONE;
+ dev_priv->int_fp1_presence = false;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = false;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_NONE;
}
} else {
- dev_private->int_fp1_presence = false;
- dev_private->int_fp1_di_port = VIA_DI_PORT_NONE;
- dev_private->int_fp2_presence = false;
- dev_private->int_fp2_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp1_presence = false;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = false;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_NONE;
}
/* Restore SR5A. */
vga_wseq(VGABASE, 0x5a, sr5a);
break;
default:
- dev_private->int_fp1_presence = false;
- dev_private->int_fp1_di_port = VIA_DI_PORT_NONE;
- dev_private->int_fp2_presence = false;
- dev_private->int_fp2_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp1_presence = false;
+ dev_priv->int_fp1_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_fp2_presence = false;
+ dev_priv->int_fp2_di_port = VIA_DI_PORT_NONE;
break;
}
- dev_private->int_fp1_i2c_bus = VIA_I2C_NONE;
- dev_private->int_fp2_i2c_bus = VIA_I2C_NONE;
+ dev_priv->int_fp1_i2c_bus = VIA_I2C_NONE;
+ dev_priv->int_fp2_i2c_bus = VIA_I2C_NONE;
/* Zero clear connector struct.
* Not doing so leads to a crash. */
@@ -1277,24 +1256,24 @@ void via_fp_probe(struct drm_device *dev)
&via_fp_connector_helper_funcs);
drm_connector_register(&connector);
- if ((dev_private->int_fp1_presence)
- && (!(dev_private->mapped_i2c_bus & VIA_I2C_BUS2))) {
+ if ((dev_priv->int_fp1_presence)
+ && (!(dev_priv->mapped_i2c_bus & VIA_I2C_BUS2))) {
i2c_bus = via_find_ddc_bus(0x31);
edid = drm_get_edid(&connector, i2c_bus);
if (edid) {
- dev_private->int_fp1_i2c_bus = VIA_I2C_BUS2;
- dev_private->mapped_i2c_bus |= VIA_I2C_BUS2;
+ dev_priv->int_fp1_i2c_bus = VIA_I2C_BUS2;
+ dev_priv->mapped_i2c_bus |= VIA_I2C_BUS2;
kfree(edid);
}
}
- if ((dev_private->int_fp2_presence)
- && (!(dev_private->mapped_i2c_bus & VIA_I2C_BUS2))) {
+ if ((dev_priv->int_fp2_presence)
+ && (!(dev_priv->mapped_i2c_bus & VIA_I2C_BUS2))) {
i2c_bus = via_find_ddc_bus(0x31);
edid = drm_get_edid(&connector, i2c_bus);
if (edid) {
- dev_private->int_fp2_i2c_bus = VIA_I2C_BUS2;
- dev_private->mapped_i2c_bus |= VIA_I2C_BUS2;
+ dev_priv->int_fp2_i2c_bus = VIA_I2C_BUS2;
+ dev_priv->mapped_i2c_bus |= VIA_I2C_BUS2;
kfree(edid);
}
}
@@ -1304,33 +1283,33 @@ void via_fp_probe(struct drm_device *dev)
drm_connector_cleanup(&connector);
DRM_DEBUG_KMS("int_fp1_presence: %x\n",
- dev_private->int_fp1_presence);
+ dev_priv->int_fp1_presence);
DRM_DEBUG_KMS("int_fp1_di_port: 0x%08x\n",
- dev_private->int_fp1_di_port);
+ dev_priv->int_fp1_di_port);
DRM_DEBUG_KMS("int_fp1_i2c_bus: 0x%08x\n",
- dev_private->int_fp1_i2c_bus);
+ dev_priv->int_fp1_i2c_bus);
DRM_DEBUG_KMS("int_fp2_presence: %x\n",
- dev_private->int_fp2_presence);
+ dev_priv->int_fp2_presence);
DRM_DEBUG_KMS("int_fp2_di_port: 0x%08x\n",
- dev_private->int_fp2_di_port);
+ dev_priv->int_fp2_di_port);
DRM_DEBUG_KMS("int_fp2_i2c_bus: 0x%08x\n",
- dev_private->int_fp2_i2c_bus);
+ dev_priv->int_fp2_i2c_bus);
DRM_DEBUG_KMS("mapped_i2c_bus: 0x%08x\n",
- dev_private->mapped_i2c_bus);
+ dev_priv->mapped_i2c_bus);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
void via_fp_init(struct drm_device *dev)
{
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct via_connector *con;
struct via_encoder *enc;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if ((!(dev_private->int_fp1_presence)) &&
- (!(dev_private->int_fp2_presence))) {
+ if ((!(dev_priv->int_fp1_presence)) &&
+ (!(dev_priv->int_fp2_presence))) {
goto exit;
}
@@ -1348,10 +1327,10 @@ void via_fp_init(struct drm_device *dev)
drm_connector_helper_add(&con->base, &via_fp_connector_helper_funcs);
drm_connector_register(&con->base);
- if (dev_private->int_fp1_presence) {
- con->i2c_bus = dev_private->int_fp1_i2c_bus;
- } else if (dev_private->int_fp2_presence) {
- con->i2c_bus = dev_private->int_fp2_i2c_bus;
+ if (dev_priv->int_fp1_presence) {
+ con->i2c_bus = dev_priv->int_fp1_i2c_bus;
+ } else if (dev_priv->int_fp2_presence) {
+ con->i2c_bus = dev_priv->int_fp2_i2c_bus;
} else {
con->i2c_bus = VIA_I2C_NONE;
}
@@ -1366,10 +1345,10 @@ void via_fp_init(struct drm_device *dev)
enc->base.possible_crtcs = BIT(1) | BIT(0);
- if (dev_private->int_fp1_presence) {
- enc->di_port = dev_private->int_fp1_di_port;
- } else if (dev_private->int_fp2_presence) {
- enc->di_port = dev_private->int_fp2_di_port;
+ if (dev_priv->int_fp1_presence) {
+ enc->di_port = dev_priv->int_fp1_di_port;
+ } else if (dev_priv->int_fp2_presence) {
+ enc->di_port = dev_priv->int_fp2_di_port;
} else {
enc->di_port = VIA_DI_PORT_NONE;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index b5f6e714dba9..3f2269da5ab7 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -52,7 +52,7 @@ static void
via_hdmi_enc_dpms(struct drm_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
switch (mode) {
case DRM_MODE_DPMS_SUSPEND:
@@ -162,7 +162,7 @@ via_hdmi_native_mode_set(struct via_crtc *iga, struct drm_display_mode *mode,
bool audio_off)
{
struct drm_device *dev = iga->base.dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
u32 reg_c280, reg_c284;
int max_packet, delay;
u8 value = BIT(0);
@@ -252,7 +252,7 @@ via_hdmi_enc_mode_set(struct drm_encoder *encoder,
struct drm_connector *connector = NULL, *con;
struct drm_device *dev = encoder->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
list_for_each_entry(con, &dev->mode_config.connector_list, head) {
if (encoder == con->encoder) {
@@ -390,10 +390,9 @@ static const struct drm_encoder_helper_funcs via_hdmi_enc_helper_funcs = {
.mode_set = via_hdmi_enc_mode_set,
};
-static unsigned int via_check_hdmi_i2c_status(
- struct via_drm_priv *dev_private,
- unsigned int check_bits,
- unsigned int condition)
+static unsigned int via_check_hdmi_i2c_status(struct via_drm_priv *dev_priv,
+ unsigned int check_bits,
+ unsigned int condition)
{
unsigned int status = true, max = 50, loop = 0;
@@ -417,10 +416,9 @@ static unsigned int via_check_hdmi_i2c_status(
return status;
}
-unsigned int via_ddc_read_bytes_by_hdmi(
- struct via_drm_priv *dev_private,
- unsigned int offset,
- unsigned char *block)
+unsigned int via_ddc_read_bytes_by_hdmi(struct via_drm_priv *dev_priv,
+ unsigned int offset,
+ unsigned char *block)
{
unsigned int status = true, temp = 0, i;
@@ -433,8 +431,7 @@ unsigned int via_ddc_read_bytes_by_hdmi(
VIA_WRITE(0xC0B8, 0x0011);
VIA_WRITE(0xC0B8, 0x0019);
if (status)
- status = via_check_hdmi_i2c_status(dev_private,
- 0x0018, true);
+ status = via_check_hdmi_i2c_status(dev_priv, 0x0018, true);
/* Slave Address */
temp = 0xA0;
@@ -443,8 +440,7 @@ unsigned int via_ddc_read_bytes_by_hdmi(
VIA_WRITE(0xC0B4, temp);
VIA_WRITE(0xC0B8, 0x0009);
if (status)
- status = via_check_hdmi_i2c_status(dev_private,
- 0x0008, true);
+ status = via_check_hdmi_i2c_status(dev_priv, 0x0008, true);
/* Offset */
temp = offset;
@@ -453,15 +449,13 @@ unsigned int via_ddc_read_bytes_by_hdmi(
VIA_WRITE(0xC0B4, temp);
VIA_WRITE(0xC0B8, 0x0009);
if (status)
- status = via_check_hdmi_i2c_status(dev_private,
- 0x0008, true);
+ status = via_check_hdmi_i2c_status(dev_priv, 0x0008, true);
/* START */
VIA_WRITE(0xC0B8, 0x0011);
VIA_WRITE(0xC0B8, 0x0019);
if (status)
- status = via_check_hdmi_i2c_status(dev_private,
- 0x0018, true);
+ status = via_check_hdmi_i2c_status(dev_priv, 0x0018, true);
/* Slave Address + 1 */
temp = 0xA1;
@@ -470,14 +464,13 @@ unsigned int via_ddc_read_bytes_by_hdmi(
VIA_WRITE(0xC0B4, temp);
VIA_WRITE(0xC0B8, 0x0009);
if (status)
- status = via_check_hdmi_i2c_status(dev_private,
- 0x0008, true);
+ status = via_check_hdmi_i2c_status(dev_priv, 0x0008, true);
for (i = 0; i < EDID_LENGTH; i++) {
/* Read Data */
VIA_WRITE(0xC0B8, 0x0009);
- via_check_hdmi_i2c_status(dev_private, 0x0008, true);
- via_check_hdmi_i2c_status(dev_private, 0x0080, false);
+ via_check_hdmi_i2c_status(dev_priv, 0x0008, true);
+ via_check_hdmi_i2c_status(dev_priv, 0x0080, false);
*block++ = (unsigned char) ((VIA_READ(0xC0B4) & 0x0000FF00) >> 8);
VIA_WRITE(0xC0B8, (VIA_READ(0xC0B8) & ~0x80));
}
@@ -486,8 +479,7 @@ unsigned int via_ddc_read_bytes_by_hdmi(
VIA_WRITE(0xC0B8, 0x0021);
VIA_WRITE(0xC0B8, 0x0029);
- status = via_check_hdmi_i2c_status(dev_private,
- 0x0828, true);
+ status = via_check_hdmi_i2c_status(dev_priv, 0x0828, true);
if (!status) {
/* Reset */
VIA_WRITE_MASK(0xC0C4, 0x00000080, 0x00000080);
@@ -501,7 +493,7 @@ via_hdmi_get_edid(struct drm_connector *connector)
{
bool print_bad_edid = !connector->bad_edid_counter || (drm_debug_enabled(DRM_UT_KMS));
struct drm_device *dev = connector->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct edid *edid = NULL;
int i, j = 0;
u8 *block;
@@ -515,8 +507,7 @@ via_hdmi_get_edid(struct drm_connector *connector)
/* base block fetch */
for (i = 0; i < 4; i++) {
- if (!via_ddc_read_bytes_by_hdmi(dev_private,
- 0, block))
+ if (!via_ddc_read_bytes_by_hdmi(dev_priv, 0, block))
goto out;
if (drm_edid_block_valid(block, 0, print_bad_edid, NULL))
@@ -544,9 +535,8 @@ via_hdmi_get_edid(struct drm_connector *connector)
offset = (valid_extensions + 1) * EDID_LENGTH;
new = block + offset;
- if (!via_ddc_read_bytes_by_hdmi(
- dev_private,
- offset, new))
+ if (!via_ddc_read_bytes_by_hdmi(dev_priv,
+ offset, new))
goto out;
if (drm_edid_block_valid(new, j, print_bad_edid, NULL)) {
@@ -593,7 +583,7 @@ static enum drm_connector_status
via_hdmi_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
enum drm_connector_status ret = connector_status_disconnected;
u32 mm_c730 = VIA_READ(0xc730) & 0xC0000000;
struct edid *edid = NULL;
diff --git a/drivers/gpu/drm/openchrome/openchrome_i2c.c b/drivers/gpu/drm/openchrome/openchrome_i2c.c
index 2f743ebfc421..bae65db25cc4 100644
--- a/drivers/gpu/drm/openchrome/openchrome_i2c.c
+++ b/drivers/gpu/drm/openchrome/openchrome_i2c.c
@@ -33,7 +33,7 @@ static void via_i2c_setsda(void *data, int state)
{
struct via_i2c_stuff *i2c = data;
struct drm_device *dev = i2c_get_adapdata(&i2c->adapter);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
u8 value, mask;
if (i2c->is_active == GPIO) {
@@ -51,7 +51,7 @@ static void via_i2c_setscl(void *data, int state)
{
struct via_i2c_stuff *i2c = data;
struct drm_device *dev = i2c_get_adapdata(&i2c->adapter);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
u8 value, mask;
if (i2c->is_active == GPIO) {
@@ -69,7 +69,7 @@ static int via_i2c_getsda(void *data)
{
struct via_i2c_stuff *i2c = data;
struct drm_device *dev = i2c_get_adapdata(&i2c->adapter);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
return vga_rseq(VGABASE, i2c->i2c_port) & BIT(2);
}
@@ -78,7 +78,7 @@ static int via_i2c_getscl(void *data)
{
struct via_i2c_stuff *i2c = data;
struct drm_device *dev = i2c_get_adapdata(&i2c->adapter);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
return vga_rseq(VGABASE, i2c->i2c_port) & BIT(3);
}
@@ -180,7 +180,7 @@ via_i2c_writebytes(struct i2c_adapter *adapter,
kfree(out_buf);
}
-void via_i2c_reg_init(struct via_drm_priv *dev_private)
+void via_i2c_reg_init(struct via_drm_priv *dev_priv)
{
svga_wseq_mask(VGABASE, 0x31, 0x30, 0x30);
svga_wseq_mask(VGABASE, 0x26, 0x30, 0x30);
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index deed4d06ce7e..bee69d406a8e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -34,7 +34,7 @@
#include "openchrome_drv.h"
-static int cle266_mem_type(struct via_drm_priv *dev_private,
+static int cle266_mem_type(struct via_drm_priv *dev_priv,
struct pci_dev *bridge)
{
u8 type, fsb, freq;
@@ -104,13 +104,13 @@ static int cle266_mem_type(struct via_drm_priv *dev_private,
case 0x00: /* SDR */
switch (freq) {
case 66:
- dev_private->vram_type = VIA_MEM_SDR66;
+ dev_priv->vram_type = VIA_MEM_SDR66;
break;
case 100:
- dev_private->vram_type = VIA_MEM_SDR100;
+ dev_priv->vram_type = VIA_MEM_SDR100;
break;
case 133:
- dev_private->vram_type = VIA_MEM_SDR133;
+ dev_priv->vram_type = VIA_MEM_SDR133;
break;
default:
break;
@@ -120,10 +120,10 @@ static int cle266_mem_type(struct via_drm_priv *dev_private,
case 0x02: /* DDR */
switch (freq) {
case 100:
- dev_private->vram_type = VIA_MEM_DDR_200;
+ dev_priv->vram_type = VIA_MEM_DDR_200;
break;
case 133:
- dev_private->vram_type = VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
default:
break;
@@ -135,7 +135,7 @@ static int cle266_mem_type(struct via_drm_priv *dev_private,
return ret;
}
-static int km400_mem_type(struct via_drm_priv *dev_private,
+static int km400_mem_type(struct via_drm_priv *dev_priv,
struct pci_dev *bridge)
{
u8 fsb, freq, rev;
@@ -161,20 +161,16 @@ static int km400_mem_type(struct via_drm_priv *dev_private,
case 0x00:
switch (freq) {
case 0x00:
- dev_private->vram_type =
- VIA_MEM_DDR_200;
+ dev_priv->vram_type = VIA_MEM_DDR_200;
break;
case 0x01:
- dev_private->vram_type =
- VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
case 0x02:
- dev_private->vram_type =
- VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
case 0x03:
- dev_private->vram_type =
- VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
default:
break;
@@ -184,16 +180,13 @@ static int km400_mem_type(struct via_drm_priv *dev_private,
case 0x01:
switch (freq) {
case 0x00:
- dev_private->vram_type =
- VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
case 0x01:
- dev_private->vram_type =
- VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x02:
- dev_private->vram_type =
- VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
default:
break;
@@ -204,15 +197,13 @@ static int km400_mem_type(struct via_drm_priv *dev_private,
case 0x03:
switch (freq) {
case 0x00:
- dev_private->vram_type = VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x02:
- dev_private->vram_type =
- VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
case 0x03:
- dev_private->vram_type =
- VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
default:
break;
@@ -233,23 +224,19 @@ static int km400_mem_type(struct via_drm_priv *dev_private,
case 0x00:
switch (freq) {
case 0x00:
- dev_private->vram_type =
- VIA_MEM_DDR_200;
+ dev_priv->vram_type = VIA_MEM_DDR_200;
break;
case 0x01:
- dev_private->vram_type =
- VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
case 0x03:
- dev_private->vram_type =
- VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x07:
- dev_private->vram_type =
- VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
default:
- dev_private->vram_type = VIA_MEM_NONE;
+ dev_priv->vram_type = VIA_MEM_NONE;
break;
}
break;
@@ -257,16 +244,13 @@ static int km400_mem_type(struct via_drm_priv *dev_private,
case 0x01:
switch (freq) {
case 0x00:
- dev_private->vram_type =
- VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
case 0x01:
- dev_private->vram_type =
- VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x03:
- dev_private->vram_type =
- VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
default:
break;
@@ -276,16 +260,13 @@ static int km400_mem_type(struct via_drm_priv *dev_private,
case 0x02:
switch (freq) {
case 0x00:
- dev_private->vram_type =
- VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
case 0x04:
- dev_private->vram_type =
- VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x06:
- dev_private->vram_type =
- VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
default:
break;
@@ -295,16 +276,13 @@ static int km400_mem_type(struct via_drm_priv *dev_private,
case 0x03:
switch (freq) {
case 0x00:
- dev_private->vram_type =
- VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x01:
- dev_private->vram_type =
- VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
case 0x04:
- dev_private->vram_type =
- VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
default:
break;
@@ -317,7 +295,7 @@ static int km400_mem_type(struct via_drm_priv *dev_private,
return ret;
}
-static int p4m800_mem_type(struct via_drm_priv *dev_private,
+static int p4m800_mem_type(struct via_drm_priv *dev_priv,
struct pci_bus *bus,
struct pci_dev *fn3)
{
@@ -368,16 +346,16 @@ static int p4m800_mem_type(struct via_drm_priv *dev_private,
switch (freq) {
case 0x03:
- dev_private->vram_type = VIA_MEM_DDR_200;
+ dev_priv->vram_type = VIA_MEM_DDR_200;
break;
case 0x04:
- dev_private->vram_type = VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
case 0x05:
- dev_private->vram_type = VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x06:
- dev_private->vram_type = VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
default:
break;
@@ -385,7 +363,7 @@ static int p4m800_mem_type(struct via_drm_priv *dev_private,
return ret;
}
-static int km8xx_mem_type(struct via_drm_priv *dev_private)
+static int km8xx_mem_type(struct via_drm_priv *dev_priv)
{
struct pci_dev *dram, *misc = NULL;
int ret = -ENXIO;
@@ -402,20 +380,16 @@ static int km8xx_mem_type(struct via_drm_priv *dev_private)
pci_read_config_byte(dram, 0x94, &type);
switch (type & 0x03) {
case 0x00:
- dev_private->vram_type =
- VIA_MEM_DDR2_400;
+ dev_priv->vram_type = VIA_MEM_DDR2_400;
break;
case 0x01:
- dev_private->vram_type =
- VIA_MEM_DDR2_533;
+ dev_priv->vram_type = VIA_MEM_DDR2_533;
break;
case 0x02:
- dev_private->vram_type =
- VIA_MEM_DDR2_667;
+ dev_priv->vram_type = VIA_MEM_DDR2_667;
break;
case 0x03:
- dev_private->vram_type =
- VIA_MEM_DDR2_800;
+ dev_priv->vram_type = VIA_MEM_DDR2_800;
break;
default:
break;
@@ -429,20 +403,16 @@ static int km8xx_mem_type(struct via_drm_priv *dev_private)
switch (type) {
case 0x00:
- dev_private->vram_type =
- VIA_MEM_DDR_200;
+ dev_priv->vram_type = VIA_MEM_DDR_200;
break;
case 0x02:
- dev_private->vram_type =
- VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
case 0x05:
- dev_private->vram_type =
- VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x07:
- dev_private->vram_type =
- VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
default:
break;
@@ -464,20 +434,16 @@ static int km8xx_mem_type(struct via_drm_priv *dev_private)
if (type & 0x01) { /* DDR3 */
switch (tmp & 0x07) {
case 0x03:
- dev_private->vram_type =
- VIA_MEM_DDR3_800;
+ dev_priv->vram_type = VIA_MEM_DDR3_800;
break;
case 0x04:
- dev_private->vram_type =
- VIA_MEM_DDR3_1066;
+ dev_priv->vram_type = VIA_MEM_DDR3_1066;
break;
case 0x05:
- dev_private->vram_type =
- VIA_MEM_DDR3_1333;
+ dev_priv->vram_type = VIA_MEM_DDR3_1333;
break;
case 0x06:
- dev_private->vram_type =
- VIA_MEM_DDR3_1600;
+ dev_priv->vram_type = VIA_MEM_DDR3_1600;
break;
default:
break;
@@ -485,24 +451,19 @@ static int km8xx_mem_type(struct via_drm_priv *dev_private)
} else { /* DDR2 */
switch (tmp & 0x07) {
case 0x00:
- dev_private->vram_type =
- VIA_MEM_DDR2_400;
+ dev_priv->vram_type = VIA_MEM_DDR2_400;
break;
case 0x01:
- dev_private->vram_type =
- VIA_MEM_DDR2_533;
+ dev_priv->vram_type = VIA_MEM_DDR2_533;
break;
case 0x02:
- dev_private->vram_type =
- VIA_MEM_DDR2_667;
+ dev_priv->vram_type = VIA_MEM_DDR2_667;
break;
case 0x03:
- dev_private->vram_type =
- VIA_MEM_DDR2_800;
+ dev_priv->vram_type = VIA_MEM_DDR2_800;
break;
case 0x04:
- dev_private->vram_type =
- VIA_MEM_DDR2_1066;
+ dev_priv->vram_type = VIA_MEM_DDR2_1066;
break;
default:
break;
@@ -520,13 +481,13 @@ static int km8xx_mem_type(struct via_drm_priv *dev_private)
switch (tmp & 0x07) {
case 0x01:
- dev_private->vram_type = VIA_MEM_DDR2_533;
+ dev_priv->vram_type = VIA_MEM_DDR2_533;
break;
case 0x02:
- dev_private->vram_type = VIA_MEM_DDR2_667;
+ dev_priv->vram_type = VIA_MEM_DDR2_667;
break;
case 0x03:
- dev_private->vram_type = VIA_MEM_DDR2_800;
+ dev_priv->vram_type = VIA_MEM_DDR2_800;
break;
default:
break;
@@ -535,7 +496,7 @@ static int km8xx_mem_type(struct via_drm_priv *dev_private)
return ret;
}
-static int cn400_mem_type(struct via_drm_priv *dev_private,
+static int cn400_mem_type(struct via_drm_priv *dev_priv,
struct pci_bus *bus,
struct pci_dev *fn3)
{
@@ -582,16 +543,16 @@ static int cn400_mem_type(struct via_drm_priv *dev_private,
switch (freq) {
case 0x03:
- dev_private->vram_type = VIA_MEM_DDR_200;
+ dev_priv->vram_type = VIA_MEM_DDR_200;
break;
case 0x04:
- dev_private->vram_type = VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
case 0x05:
- dev_private->vram_type = VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x06:
- dev_private->vram_type = VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
default:
break;
@@ -599,7 +560,7 @@ static int cn400_mem_type(struct via_drm_priv *dev_private,
return ret;
}
-static int cn700_mem_type(struct via_drm_priv *dev_private,
+static int cn700_mem_type(struct via_drm_priv *dev_priv,
struct pci_dev *fn3)
{
int ret;
@@ -609,22 +570,22 @@ static int cn700_mem_type(struct via_drm_priv *dev_private,
if (!ret) {
switch (tmp & 0x07) {
case 0x00:
- dev_private->vram_type = VIA_MEM_DDR_200;
+ dev_priv->vram_type = VIA_MEM_DDR_200;
break;
case 0x01:
- dev_private->vram_type = VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
case 0x02:
- dev_private->vram_type = VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 0x03:
- dev_private->vram_type = VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
case 0x04:
- dev_private->vram_type = VIA_MEM_DDR2_400;
+ dev_priv->vram_type = VIA_MEM_DDR2_400;
break;
case 0x05:
- dev_private->vram_type = VIA_MEM_DDR2_533;
+ dev_priv->vram_type = VIA_MEM_DDR2_533;
break;
default:
break;
@@ -633,7 +594,7 @@ static int cn700_mem_type(struct via_drm_priv *dev_private,
return ret;
}
-static int cx700_mem_type(struct via_drm_priv *dev_private,
+static int cx700_mem_type(struct via_drm_priv *dev_priv,
struct pci_dev *fn3)
{
u8 type, clock;
@@ -652,16 +613,16 @@ static int cx700_mem_type(struct via_drm_priv *dev_private,
case 0:
switch (clock & 0x07) {
case 0:
- dev_private->vram_type = VIA_MEM_DDR_200;
+ dev_priv->vram_type = VIA_MEM_DDR_200;
break;
case 1:
- dev_private->vram_type = VIA_MEM_DDR_266;
+ dev_priv->vram_type = VIA_MEM_DDR_266;
break;
case 2:
- dev_private->vram_type = VIA_MEM_DDR_333;
+ dev_priv->vram_type = VIA_MEM_DDR_333;
break;
case 3:
- dev_private->vram_type = VIA_MEM_DDR_400;
+ dev_priv->vram_type = VIA_MEM_DDR_400;
break;
default:
break;
@@ -671,16 +632,16 @@ static int cx700_mem_type(struct via_drm_priv *dev_private,
case 1:
switch (clock & 0x07) {
case 3:
- dev_private->vram_type = VIA_MEM_DDR2_400;
+ dev_priv->vram_type = VIA_MEM_DDR2_400;
break;
case 4:
- dev_private->vram_type = VIA_MEM_DDR2_533;
+ dev_priv->vram_type = VIA_MEM_DDR2_533;
break;
case 5:
- dev_private->vram_type = VIA_MEM_DDR2_667;
+ dev_priv->vram_type = VIA_MEM_DDR2_667;
break;
case 6:
- dev_private->vram_type = VIA_MEM_DDR2_800;
+ dev_priv->vram_type = VIA_MEM_DDR2_800;
break;
default:
break;
@@ -692,7 +653,7 @@ static int cx700_mem_type(struct via_drm_priv *dev_private,
return ret;
}
-static int vx900_mem_type(struct via_drm_priv *dev_private,
+static int vx900_mem_type(struct via_drm_priv *dev_priv,
struct pci_dev *fn3)
{
int ret;
@@ -715,23 +676,21 @@ static int vx900_mem_type(struct via_drm_priv *dev_private,
switch (clock & 0x0F) {
case 0:
if (volt)
- dev_private->vram_type =
- VIA_MEM_DDR2_800;
+ dev_priv->vram_type = VIA_MEM_DDR2_800;
else
- dev_private->vram_type =
- VIA_MEM_DDR2_533;
+ dev_priv->vram_type = VIA_MEM_DDR2_533;
break;
case 4:
- dev_private->vram_type = VIA_MEM_DDR2_533;
+ dev_priv->vram_type = VIA_MEM_DDR2_533;
break;
case 5:
- dev_private->vram_type = VIA_MEM_DDR2_667;
+ dev_priv->vram_type = VIA_MEM_DDR2_667;
break;
case 6:
- dev_private->vram_type = VIA_MEM_DDR2_800;
+ dev_priv->vram_type = VIA_MEM_DDR2_800;
break;
case 7:
- dev_private->vram_type = VIA_MEM_DDR2_1066;
+ dev_priv->vram_type = VIA_MEM_DDR2_1066;
break;
default:
break;
@@ -741,23 +700,21 @@ static int vx900_mem_type(struct via_drm_priv *dev_private,
switch (clock & 0x0F) {
case 0:
if (volt)
- dev_private->vram_type =
- VIA_MEM_DDR3_800;
+ dev_priv->vram_type = VIA_MEM_DDR3_800;
else
- dev_private->vram_type =
- VIA_MEM_DDR3_533;
+ dev_priv->vram_type = VIA_MEM_DDR3_533;
break;
case 4:
- dev_private->vram_type = VIA_MEM_DDR3_533;
+ dev_priv->vram_type = VIA_MEM_DDR3_533;
break;
case 5:
- dev_private->vram_type = VIA_MEM_DDR3_667;
+ dev_priv->vram_type = VIA_MEM_DDR3_667;
break;
case 6:
- dev_private->vram_type = VIA_MEM_DDR3_800;
+ dev_priv->vram_type = VIA_MEM_DDR3_800;
break;
case 7:
- dev_private->vram_type = VIA_MEM_DDR3_1066;
+ dev_priv->vram_type = VIA_MEM_DDR3_1066;
break;
default:
break;
@@ -767,9 +724,9 @@ static int vx900_mem_type(struct via_drm_priv *dev_private,
return ret;
}
-int openchrome_vram_detect(struct via_drm_priv *dev_private)
+int openchrome_vram_detect(struct via_drm_priv *dev_priv)
{
- struct drm_device *dev = &dev_private->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;
@@ -803,48 +760,43 @@ int openchrome_vram_detect(struct via_drm_priv *dev_private)
}
if (pdev->device == PCI_DEVICE_ID_VIA_VX900_VGA) {
- dev_private->vram_start =
- pci_resource_start(pdev, 2);
+ dev_priv->vram_start = pci_resource_start(pdev, 2);
} else {
- dev_private->vram_start =
- pci_resource_start(pdev, 0);
+ dev_priv->vram_start = pci_resource_start(pdev, 0);
}
switch (bridge->device) {
/* CLE266 */
case PCI_DEVICE_ID_VIA_862X_0:
- ret = cle266_mem_type(dev_private, bridge);
+ ret = cle266_mem_type(dev_priv, bridge);
if (ret)
goto out_err;
ret = pci_read_config_byte(bridge, 0xE1, &size);
if (ret)
goto out_err;
- dev_private->vram_size =
- (1 << ((size & 0x70) >> 4)) << 20;
+ dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
break;
/* KM400 / KN400 / KM400A / KN400A */
case PCI_DEVICE_ID_VIA_8378_0:
- ret = km400_mem_type(dev_private, bridge);
+ ret = km400_mem_type(dev_priv, bridge);
ret = pci_read_config_byte(bridge, 0xE1, &size);
if (ret)
goto out_err;
- dev_private->vram_size =
- (1 << ((size & 0x70) >> 4)) << 20;
+ dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
break;
/* P4M800 */
case PCI_DEVICE_ID_VIA_3296_0:
- ret = p4m800_mem_type(dev_private, bus, fn3);
+ ret = p4m800_mem_type(dev_priv, bus, fn3);
ret = pci_read_config_byte(fn3, 0xA1, &size);
if (ret)
goto out_err;
- dev_private->vram_size =
- (1 << ((size & 0x70) >> 4)) << 20;
+ dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
break;
/* K8M800 / K8N800 */
@@ -854,13 +806,12 @@ int openchrome_vram_detect(struct via_drm_priv *dev_private)
ret = pci_read_config_byte(fn3, 0xA1, &size);
if (ret)
goto out_err;
- dev_private->vram_size =
- (1 << ((size & 0x70) >> 4)) << 20;
+ dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
if (bridge->device == PCI_DEVICE_ID_VIA_VT3336)
- dev_private->vram_size <<= 2;
+ dev_priv->vram_size <<= 2;
- ret = km8xx_mem_type(dev_private);
+ ret = km8xx_mem_type(dev_priv);
if (ret)
goto out_err;
break;
@@ -870,10 +821,9 @@ int openchrome_vram_detect(struct via_drm_priv *dev_private)
ret = pci_read_config_byte(fn3, 0xA1, &size);
if (ret)
goto out_err;
- dev_private->vram_size =
- (1 << ((size & 0x70) >> 4)) << 20;
+ dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
- ret = cn400_mem_type(dev_private, bus, fn3);
+ ret = cn400_mem_type(dev_priv, bus, fn3);
if (ret)
goto out_err;
break;
@@ -885,13 +835,12 @@ int openchrome_vram_detect(struct via_drm_priv *dev_private)
ret = pci_read_config_byte(fn3, 0xA1, &size);
if (ret)
goto out_err;
- dev_private->vram_size =
- (1 << ((size & 0x70) >> 4)) << 20;
+ dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
if (bridge->device != PCI_DEVICE_ID_VIA_P4M800CE)
- dev_private->vram_size <<= 2;
+ dev_priv->vram_size <<= 2;
- ret = cn700_mem_type(dev_private, fn3);
+ ret = cn700_mem_type(dev_priv, fn3);
if (ret)
goto out_err;
break;
@@ -907,10 +856,9 @@ int openchrome_vram_detect(struct via_drm_priv *dev_private)
ret = pci_read_config_byte(fn3, 0xA1, &size);
if (ret)
goto out_err;
- dev_private->vram_size =
- (1 << ((size & 0x70) >> 4)) << 22;
+ dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 22;
- ret = cx700_mem_type(dev_private, fn3);
+ ret = cx700_mem_type(dev_priv, fn3);
if (ret)
goto out_err;
break;
@@ -920,10 +868,9 @@ int openchrome_vram_detect(struct via_drm_priv *dev_private)
ret = pci_read_config_byte(fn3, 0xA1, &size);
if (ret)
goto out_err;
- dev_private->vram_size =
- (1 << ((size & 0x70) >> 4)) << 22;
+ dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 22;
- ret = vx900_mem_type(dev_private, fn3);
+ ret = vx900_mem_type(dev_priv, fn3);
if (ret)
goto out_err;
break;
@@ -934,7 +881,7 @@ int openchrome_vram_detect(struct via_drm_priv *dev_private)
goto out_err;
}
- switch (dev_private->vram_type) {
+ switch (dev_priv->vram_type) {
case VIA_MEM_SDR66:
name = "SDR 66";
break;
@@ -1004,19 +951,19 @@ out_err:
return ret;
}
-static void openchrome_flag_init(struct via_drm_priv *dev_private)
+static void openchrome_flag_init(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
/* Set this flag for ttm_bo_device_init. */
- dev_private->need_dma32 = true;
+ dev_priv->need_dma32 = true;
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_quirks_init(struct via_drm_priv *dev_private)
+static void openchrome_quirks_init(struct via_drm_priv *dev_priv)
{
- struct drm_device *dev = &dev_private->dev;
+ struct drm_device *dev = &dev_priv->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1033,9 +980,9 @@ static void openchrome_quirks_init(struct via_drm_priv *dev_private)
if ((pdev->device == PCI_DEVICE_ID_VIA_VT3157) &&
(pdev->subsystem_vendor == 0x1509) &&
(pdev->subsystem_device == 0x2d30)) {
- dev_private->is_via_nanobook = true;
+ dev_priv->is_via_nanobook = true;
} else {
- dev_private->is_via_nanobook = false;
+ dev_priv->is_via_nanobook = false;
}
/*
@@ -1046,9 +993,9 @@ static void openchrome_quirks_init(struct via_drm_priv *dev_private)
if ((pdev->device == PCI_DEVICE_ID_VIA_VT1122) &&
(pdev->subsystem_vendor == 0x152d) &&
(pdev->subsystem_device == 0x0771)) {
- dev_private->is_quanta_il1 = true;
+ dev_priv->is_quanta_il1 = true;
} else {
- dev_private->is_quanta_il1 = false;
+ dev_priv->is_quanta_il1 = false;
}
/*
@@ -1060,46 +1007,45 @@ static void openchrome_quirks_init(struct via_drm_priv *dev_private)
if ((pdev->device == PCI_DEVICE_ID_VIA_VT1122) &&
(pdev->subsystem_vendor == 0x144d) &&
(pdev->subsystem_device == 0xc04e)) {
- dev_private->is_samsung_nc20 = true;
+ dev_priv->is_samsung_nc20 = true;
} else {
- dev_private->is_samsung_nc20 = false;
+ dev_priv->is_samsung_nc20 = false;
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_vram_init(struct via_drm_priv *dev_private)
+int openchrome_vram_init(struct via_drm_priv *dev_priv)
{
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
/* Add an MTRR for the video RAM. */
- dev_private->vram_mtrr = arch_phys_wc_add(
- dev_private->vram_start,
- dev_private->vram_size);
+ dev_priv->vram_mtrr = arch_phys_wc_add(dev_priv->vram_start,
+ dev_priv->vram_size);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
}
-void openchrome_vram_fini(struct via_drm_priv *dev_private)
+void openchrome_vram_fini(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if (dev_private->vram_mtrr) {
- arch_phys_wc_del(dev_private->vram_mtrr);
- arch_io_free_memtype_wc(dev_private->vram_start,
- dev_private->vram_size);
- dev_private->vram_mtrr = 0;
+ if (dev_priv->vram_mtrr) {
+ arch_phys_wc_del(dev_priv->vram_mtrr);
+ arch_io_free_memtype_wc(dev_priv->vram_start,
+ dev_priv->vram_size);
+ dev_priv->vram_mtrr = 0;
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_mmio_init(struct via_drm_priv *dev_private)
+int openchrome_mmio_init(struct via_drm_priv *dev_priv)
{
- struct drm_device *dev = &dev_private->dev;
+ struct drm_device *dev = &dev_priv->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
int ret = 0;
@@ -1111,11 +1057,11 @@ int openchrome_mmio_init(struct via_drm_priv *dev_private)
* Obtain the starting base address and size, and
* map it to the OS for use.
*/
- dev_private->mmio_base = pci_resource_start(pdev, 1);
- dev_private->mmio_size = pci_resource_len(pdev, 1);
- dev_private->mmio = ioremap(dev_private->mmio_base,
- dev_private->mmio_size);
- if (!dev_private->mmio) {
+ dev_priv->mmio_base = pci_resource_start(pdev, 1);
+ dev_priv->mmio_size = pci_resource_len(pdev, 1);
+ dev_priv->mmio = ioremap(dev_priv->mmio_base,
+ dev_priv->mmio_size);
+ if (!dev_priv->mmio) {
ret = -ENOMEM;
goto exit;
}
@@ -1125,19 +1071,19 @@ exit:
return ret;
}
-void openchrome_mmio_fini(struct via_drm_priv *dev_private)
+void openchrome_mmio_fini(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if (dev_private->mmio) {
- iounmap(dev_private->mmio);
- dev_private->mmio = NULL;
+ if (dev_priv->mmio) {
+ iounmap(dev_priv->mmio);
+ dev_priv->mmio = NULL;
}
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_graphics_unlock(struct via_drm_priv *dev_private)
+void openchrome_graphics_unlock(struct via_drm_priv *dev_priv)
{
uint8_t temp;
@@ -1165,9 +1111,9 @@ void openchrome_graphics_unlock(struct via_drm_priv *dev_private)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void chip_revision_info(struct via_drm_priv *dev_private)
+void chip_revision_info(struct via_drm_priv *dev_priv)
{
- struct drm_device *dev = &dev_private->dev;
+ struct drm_device *dev = &dev_priv->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
u8 tmp;
@@ -1180,9 +1126,9 @@ void chip_revision_info(struct via_drm_priv *dev_private)
tmp = vga_rcrt(VGABASE, 0x4F);
vga_wcrt(VGABASE, 0x4F, 0x55);
if (vga_rcrt(VGABASE, 0x4F) != 0x55) {
- dev_private->revision = CLE266_REVISION_AX;
+ dev_priv->revision = CLE266_REVISION_AX;
} else {
- dev_private->revision = CLE266_REVISION_CX;
+ dev_priv->revision = CLE266_REVISION_CX;
}
/* Restore original CR4F value. */
@@ -1192,11 +1138,11 @@ void chip_revision_info(struct via_drm_priv *dev_private)
case PCI_DEVICE_ID_VIA_VT3157:
tmp = vga_rseq(VGABASE, 0x43);
if (tmp & 0x02) {
- dev_private->revision = CX700_REVISION_700M2;
+ dev_priv->revision = CX700_REVISION_700M2;
} else if (tmp & 0x40) {
- dev_private->revision = CX700_REVISION_700M;
+ dev_priv->revision = CX700_REVISION_700M;
} else {
- dev_private->revision = CX700_REVISION_700;
+ dev_priv->revision = CX700_REVISION_700;
}
break;
@@ -1207,7 +1153,7 @@ void chip_revision_info(struct via_drm_priv *dev_private)
case PCI_DEVICE_ID_VIA_VX875:
/* VX900 Chipset */
case PCI_DEVICE_ID_VIA_VX900_VGA:
- dev_private->revision = vga_rseq(VGABASE, 0x3B);
+ dev_priv->revision = vga_rseq(VGABASE, 0x3B);
break;
default:
break;
@@ -1216,16 +1162,16 @@ void chip_revision_info(struct via_drm_priv *dev_private)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_device_init(struct via_drm_priv *dev_private)
+int openchrome_device_init(struct via_drm_priv *dev_priv)
{
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- openchrome_flag_init(dev_private);
- openchrome_quirks_init(dev_private);
+ openchrome_flag_init(dev_priv);
+ openchrome_quirks_init(dev_priv);
- ret = openchrome_vram_detect(dev_private);
+ ret = openchrome_vram_detect(dev_priv);
if (ret) {
DRM_ERROR("Failed to detect video RAM.\n");
goto exit;
@@ -1234,30 +1180,30 @@ int openchrome_device_init(struct via_drm_priv *dev_private)
/*
* Map VRAM.
*/
- ret = openchrome_vram_init(dev_private);
+ ret = openchrome_vram_init(dev_priv);
if (ret) {
DRM_ERROR("Failed to initialize video RAM.\n");
goto exit;
}
- ret = openchrome_mmio_init(dev_private);
+ ret = openchrome_mmio_init(dev_priv);
if (ret) {
DRM_ERROR("Failed to initialize MMIO.\n");
goto exit;
}
- openchrome_graphics_unlock(dev_private);
+ openchrome_graphics_unlock(dev_priv);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
}
-void openchrome_device_fini(struct via_drm_priv *dev_private)
+void openchrome_device_fini(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- openchrome_mmio_fini(dev_private);
- openchrome_vram_fini(dev_private);
+ openchrome_mmio_fini(dev_priv);
+ openchrome_vram_fini(dev_priv);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -1269,9 +1215,9 @@ drm_mode_config_funcs openchrome_drm_mode_config_funcs = {
.atomic_commit = drm_atomic_helper_commit,
};
-void openchrome_mode_config_init(struct via_drm_priv *dev_private)
+void openchrome_mode_config_init(struct via_drm_priv *dev_priv)
{
- struct drm_device *dev = &dev_private->dev;
+ struct drm_device *dev = &dev_priv->dev;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1284,7 +1230,7 @@ void openchrome_mode_config_init(struct via_drm_priv *dev_private)
dev->mode_config.funcs = &openchrome_drm_mode_config_funcs;
- dev->mode_config.fb_base = dev_private->vram_start;
+ dev->mode_config.fb_base = dev_priv->vram_start;
dev->mode_config.preferred_depth = 24;
dev->mode_config.prefer_shadow_fbdev = true;
@@ -1297,26 +1243,26 @@ void openchrome_mode_config_init(struct via_drm_priv *dev_private)
int openchrome_drm_init(struct drm_device *dev)
{
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- dev_private->vram_mtrr = -ENXIO;
+ dev_priv->vram_mtrr = -ENXIO;
- ret = openchrome_device_init(dev_private);
+ ret = openchrome_device_init(dev_priv);
if (ret) {
DRM_ERROR("Failed to initialize Chrome IGP.\n");
goto exit;
}
- ret = openchrome_mm_init(dev_private);
+ ret = openchrome_mm_init(dev_priv);
if (ret) {
DRM_ERROR("Failed to initialize TTM.\n");
goto exit;
}
- chip_revision_info(dev_private);
+ chip_revision_info(dev_priv);
ret = via_modeset_init(dev);
if (ret) {
@@ -1327,9 +1273,9 @@ int openchrome_drm_init(struct drm_device *dev)
goto exit;
error_modeset:
via_modeset_fini(dev);
- openchrome_mm_fini(dev_private);
- openchrome_mmio_fini(dev_private);
- openchrome_vram_fini(dev_private);
+ openchrome_mm_fini(dev_priv);
+ openchrome_mmio_fini(dev_priv);
+ openchrome_vram_fini(dev_priv);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
@@ -1337,14 +1283,14 @@ exit:
void openchrome_drm_fini(struct drm_device *dev)
{
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
via_modeset_fini(dev);
- openchrome_mm_fini(dev_private);
- openchrome_mmio_fini(dev_private);
- openchrome_vram_fini(dev_private);
+ openchrome_mm_fini(dev_priv);
+ openchrome_mmio_fini(dev_priv);
+ openchrome_vram_fini(dev_priv);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioctl.c b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
index e207647f9662..1b0e743be363 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioctl.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
@@ -43,7 +43,7 @@ static int openchrome_gem_create_ioctl(struct drm_device *dev,
struct drm_file *file_priv)
{
struct drm_openchrome_gem_create *args = data;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct openchrome_bo *bo;
uint32_t handle;
int ret;
@@ -51,7 +51,7 @@ static int openchrome_gem_create_ioctl(struct drm_device *dev,
DRM_DEBUG_KMS("Entered %s.\n", __func__);
ret = openchrome_bo_create(dev,
- &dev_private->bdev,
+ &dev_priv->bdev,
args->size,
ttm_bo_type_device,
args->domain,
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c b/drivers/gpu/drm/openchrome/openchrome_object.c
index 97a8bbbb9fe8..bd476e01393c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -173,7 +173,7 @@ int openchrome_bo_create(struct drm_device *dev,
bool kmap,
struct openchrome_bo **bo_ptr)
{
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct openchrome_bo *bo;
int ret;
@@ -203,7 +203,7 @@ int openchrome_bo_create(struct drm_device *dev,
bo->ttm_bo.base.funcs = &openchrome_gem_object_funcs;
openchrome_ttm_domain_to_placement(bo, ttm_domain);
- ret = ttm_bo_init(&dev_private->bdev,
+ ret = ttm_bo_init(&dev_priv->bdev,
&bo->ttm_bo,
size,
type,
@@ -275,9 +275,9 @@ exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_mm_init(struct via_drm_priv *dev_private)
+int openchrome_mm_init(struct via_drm_priv *dev_priv)
{
- struct drm_device *dev = &dev_private->dev;
+ struct drm_device *dev = &dev_priv->dev;
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -285,13 +285,13 @@ int openchrome_mm_init(struct via_drm_priv *dev_private)
/*
* Initialize bdev ttm_bo_device struct.
*/
- ret = ttm_device_init(&dev_private->bdev,
+ ret = ttm_device_init(&dev_priv->bdev,
&openchrome_bo_driver,
dev->dev,
dev->anon_inode->i_mapping,
dev->vma_offset_manager,
false,
- dev_private->need_dma32);
+ dev_priv->need_dma32);
if (ret) {
DRM_ERROR("Failed initializing buffer object driver.\n");
goto exit;
@@ -300,9 +300,9 @@ int openchrome_mm_init(struct via_drm_priv *dev_private)
/*
* Initialize TTM range manager for VRAM management.
*/
- ret = ttm_range_man_init(&dev_private->bdev, TTM_PL_VRAM,
+ ret = ttm_range_man_init(&dev_priv->bdev, TTM_PL_VRAM,
false,
- dev_private->vram_size >> PAGE_SHIFT);
+ dev_priv->vram_size >> PAGE_SHIFT);
if (ret) {
DRM_ERROR("Failed initializing TTM VRAM memory manager.\n");
goto exit;
@@ -313,13 +313,13 @@ exit:
return ret;
}
-void openchrome_mm_fini(struct via_drm_priv *dev_private)
+void openchrome_mm_fini(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- ttm_range_man_fini(&dev_private->bdev, TTM_PL_VRAM);
+ ttm_range_man_fini(&dev_priv->bdev, TTM_PL_VRAM);
- ttm_device_fini(&dev_private->bdev);
+ ttm_device_fini(&dev_priv->bdev);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_pm.c b/drivers/gpu/drm/openchrome/openchrome_pm.c
index 26b9a58c2d76..02bd4d72b6ef 100644
--- a/drivers/gpu/drm/openchrome/openchrome_pm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_pm.c
@@ -39,7 +39,7 @@ int openchrome_dev_pm_ops_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
- struct via_drm_priv *dev_private = to_via_drm_priv(drm_dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(drm_dev);
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -56,18 +56,18 @@ int openchrome_dev_pm_ops_suspend(struct device *dev)
if ((pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
(pdev->device == PCI_DEVICE_ID_VIA_VX875) ||
(pdev->device == PCI_DEVICE_ID_VIA_VX900_VGA)) {
- dev_private->saved_sr14 = vga_rseq(VGABASE, 0x14);
-
- dev_private->saved_sr66 = vga_rseq(VGABASE, 0x66);
- dev_private->saved_sr67 = vga_rseq(VGABASE, 0x67);
- dev_private->saved_sr68 = vga_rseq(VGABASE, 0x68);
- dev_private->saved_sr69 = vga_rseq(VGABASE, 0x69);
- dev_private->saved_sr6a = vga_rseq(VGABASE, 0x6a);
- dev_private->saved_sr6b = vga_rseq(VGABASE, 0x6b);
- dev_private->saved_sr6c = vga_rseq(VGABASE, 0x6c);
- dev_private->saved_sr6d = vga_rseq(VGABASE, 0x6d);
- dev_private->saved_sr6e = vga_rseq(VGABASE, 0x6e);
- dev_private->saved_sr6f = vga_rseq(VGABASE, 0x6f);
+ dev_priv->saved_sr14 = vga_rseq(VGABASE, 0x14);
+
+ dev_priv->saved_sr66 = vga_rseq(VGABASE, 0x66);
+ dev_priv->saved_sr67 = vga_rseq(VGABASE, 0x67);
+ dev_priv->saved_sr68 = vga_rseq(VGABASE, 0x68);
+ dev_priv->saved_sr69 = vga_rseq(VGABASE, 0x69);
+ dev_priv->saved_sr6a = vga_rseq(VGABASE, 0x6a);
+ dev_priv->saved_sr6b = vga_rseq(VGABASE, 0x6b);
+ dev_priv->saved_sr6c = vga_rseq(VGABASE, 0x6c);
+ dev_priv->saved_sr6d = vga_rseq(VGABASE, 0x6d);
+ dev_priv->saved_sr6e = vga_rseq(VGABASE, 0x6e);
+ dev_priv->saved_sr6f = vga_rseq(VGABASE, 0x6f);
}
/*
@@ -76,11 +76,11 @@ int openchrome_dev_pm_ops_suspend(struct device *dev)
* Their values need to be saved because they get lost
* when resuming from standby.
*/
- dev_private->saved_cr3b = vga_rcrt(VGABASE, 0x3b);
- dev_private->saved_cr3c = vga_rcrt(VGABASE, 0x3c);
- dev_private->saved_cr3d = vga_rcrt(VGABASE, 0x3d);
- dev_private->saved_cr3e = vga_rcrt(VGABASE, 0x3e);
- dev_private->saved_cr3f = vga_rcrt(VGABASE, 0x3f);
+ dev_priv->saved_cr3b = vga_rcrt(VGABASE, 0x3b);
+ dev_priv->saved_cr3c = vga_rcrt(VGABASE, 0x3c);
+ dev_priv->saved_cr3d = vga_rcrt(VGABASE, 0x3d);
+ dev_priv->saved_cr3e = vga_rcrt(VGABASE, 0x3e);
+ dev_priv->saved_cr3f = vga_rcrt(VGABASE, 0x3f);
console_unlock();
@@ -101,7 +101,7 @@ int openchrome_dev_pm_ops_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
- struct via_drm_priv *dev_private = to_via_drm_priv(drm_dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(drm_dev);
void __iomem *regs = ioport_map(0x3c0, 100);
u8 val;
int ret = 0;
@@ -150,18 +150,18 @@ int openchrome_dev_pm_ops_resume(struct device *dev)
if ((pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
(pdev->device == PCI_DEVICE_ID_VIA_VX875) ||
(pdev->device == PCI_DEVICE_ID_VIA_VX900_VGA)) {
- vga_wseq(VGABASE, 0x14, dev_private->saved_sr14);
-
- vga_wseq(VGABASE, 0x66, dev_private->saved_sr66);
- vga_wseq(VGABASE, 0x67, dev_private->saved_sr67);
- vga_wseq(VGABASE, 0x68, dev_private->saved_sr68);
- vga_wseq(VGABASE, 0x69, dev_private->saved_sr69);
- vga_wseq(VGABASE, 0x6a, dev_private->saved_sr6a);
- vga_wseq(VGABASE, 0x6b, dev_private->saved_sr6b);
- vga_wseq(VGABASE, 0x6c, dev_private->saved_sr6c);
- vga_wseq(VGABASE, 0x6d, dev_private->saved_sr6d);
- vga_wseq(VGABASE, 0x6e, dev_private->saved_sr6e);
- vga_wseq(VGABASE, 0x6f, dev_private->saved_sr6f);
+ vga_wseq(VGABASE, 0x14, dev_priv->saved_sr14);
+
+ vga_wseq(VGABASE, 0x66, dev_priv->saved_sr66);
+ vga_wseq(VGABASE, 0x67, dev_priv->saved_sr67);
+ vga_wseq(VGABASE, 0x68, dev_priv->saved_sr68);
+ vga_wseq(VGABASE, 0x69, dev_priv->saved_sr69);
+ vga_wseq(VGABASE, 0x6a, dev_priv->saved_sr6a);
+ vga_wseq(VGABASE, 0x6b, dev_priv->saved_sr6b);
+ vga_wseq(VGABASE, 0x6c, dev_priv->saved_sr6c);
+ vga_wseq(VGABASE, 0x6d, dev_priv->saved_sr6d);
+ vga_wseq(VGABASE, 0x6e, dev_priv->saved_sr6e);
+ vga_wseq(VGABASE, 0x6f, dev_priv->saved_sr6f);
}
/*
@@ -170,11 +170,11 @@ int openchrome_dev_pm_ops_resume(struct device *dev)
* Their values need to be restored because they are undefined
* after resuming from standby.
*/
- vga_wcrt(VGABASE, 0x3b, dev_private->saved_cr3b);
- vga_wcrt(VGABASE, 0x3c, dev_private->saved_cr3c);
- vga_wcrt(VGABASE, 0x3d, dev_private->saved_cr3d);
- vga_wcrt(VGABASE, 0x3e, dev_private->saved_cr3e);
- vga_wcrt(VGABASE, 0x3f, dev_private->saved_cr3f);
+ vga_wcrt(VGABASE, 0x3b, dev_priv->saved_cr3b);
+ vga_wcrt(VGABASE, 0x3c, dev_priv->saved_cr3c);
+ vga_wcrt(VGABASE, 0x3d, dev_priv->saved_cr3d);
+ vga_wcrt(VGABASE, 0x3e, dev_priv->saved_cr3e);
+ vga_wcrt(VGABASE, 0x3f, dev_priv->saved_cr3f);
console_unlock();
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/openchrome_sii164.c
index 460d4ed43494..8ca745691eaa 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -135,7 +135,7 @@ static void openchrome_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -159,15 +159,15 @@ static void openchrome_sii164_dpms(struct drm_encoder *encoder, int mode)
switch (mode) {
case DRM_MODE_DPMS_ON:
openchrome_sii164_power(i2c_bus, true);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, true);
+ openchrome_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:
openchrome_sii164_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, false);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port,
+ false);
break;
default:
DRM_ERROR("Bad DPMS mode.");
@@ -198,7 +198,7 @@ static void openchrome_sii164_mode_set(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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -218,19 +218,18 @@ static void openchrome_sii164_mode_set(struct drm_encoder *encoder,
goto exit;
}
- openchrome_transmitter_clock_drive_strength(dev_private,
- enc->di_port, 0x03);
- openchrome_transmitter_data_drive_strength(dev_private,
- enc->di_port, 0x03);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, true);
+ openchrome_transmitter_clock_drive_strength(dev_priv, enc->di_port,
+ 0x03);
+ openchrome_transmitter_data_drive_strength(dev_priv, enc->di_port,
+ 0x03);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, true);
openchrome_sii164_display_registers(i2c_bus);
openchrome_sii164_init_registers(i2c_bus);
openchrome_sii164_display_registers(i2c_bus);
- openchrome_transmitter_display_source(dev_private,
- enc->di_port, iga->index);
+ openchrome_transmitter_display_source(dev_priv, enc->di_port,
+ iga->index);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -241,7 +240,7 @@ static void openchrome_sii164_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -262,8 +261,7 @@ static void openchrome_sii164_prepare(struct drm_encoder *encoder)
}
openchrome_sii164_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, false);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, false);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -273,7 +271,7 @@ static void openchrome_sii164_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -294,8 +292,7 @@ static void openchrome_sii164_commit(struct drm_encoder *encoder)
}
openchrome_sii164_power(i2c_bus, true);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, true);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, true);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -306,7 +303,7 @@ static void openchrome_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -327,8 +324,7 @@ static void openchrome_sii164_disable(struct drm_encoder *encoder)
}
openchrome_sii164_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, false);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, false);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -526,11 +522,11 @@ void openchrome_sii164_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if (!dev_private->ext_tmds_presence) {
+ if (!dev_priv->ext_tmds_presence) {
goto exit;
}
@@ -548,11 +544,11 @@ void openchrome_sii164_init(struct drm_device *dev)
enc->base.possible_crtcs = BIT(1) | BIT(0);
enc->base.possible_clones = 0;
- enc->i2c_bus = dev_private->ext_tmds_i2c_bus;
- enc->di_port = dev_private->ext_tmds_di_port;
+ enc->i2c_bus = dev_priv->ext_tmds_i2c_bus;
+ enc->di_port = dev_priv->ext_tmds_di_port;
/* Increment the number of DVI connectors. */
- dev_private->number_dvi++;
+ dev_priv->number_dvi++;
con = &enc->cons[0];
@@ -565,7 +561,7 @@ void openchrome_sii164_init(struct drm_device *dev)
con->base.doublescan_allowed = false;
con->base.interlace_allowed = false;
- con->i2c_bus = dev_private->ext_tmds_i2c_bus;
+ con->i2c_bus = dev_priv->ext_tmds_i2c_bus;
INIT_LIST_HEAD(&con->props);
drm_connector_attach_encoder(&con->base, &enc->base);
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/openchrome_tmds.c
index 1242188802b1..faac91aed175 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -34,7 +34,7 @@
#include "openchrome_drv.h"
-static void via_tmds_power(struct via_drm_priv *dev_private,
+static void via_tmds_power(struct via_drm_priv *dev_priv,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -55,7 +55,7 @@ static void via_tmds_power(struct via_drm_priv *dev_private,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_tmds_io_pad_setting(struct via_drm_priv *dev_private,
+static void via_tmds_io_pad_setting(struct via_drm_priv *dev_priv,
u32 di_port, bool io_pad_on)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -79,7 +79,7 @@ static void via_tmds_io_pad_setting(struct via_drm_priv *dev_private,
* 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_private)
+static void via_tmds_init_reg(struct via_drm_priv *dev_priv)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -148,7 +148,7 @@ static void via_tmds_init_reg(struct via_drm_priv *dev_private)
/*
* Set TMDS (DVI) sync polarity.
*/
-static void via_tmds_sync_polarity(struct via_drm_priv *dev_private,
+static void via_tmds_sync_polarity(struct via_drm_priv *dev_priv,
unsigned int flags)
{
u8 syncPolarity = 0x00;
@@ -175,7 +175,7 @@ static void via_tmds_sync_polarity(struct via_drm_priv *dev_private,
/*
* Sets TMDS (DVI) display source.
*/
-static void via_tmds_display_source(struct via_drm_priv *dev_private,
+static void via_tmds_display_source(struct via_drm_priv *dev_priv,
int index)
{
u8 displaySource = index;
@@ -201,22 +201,20 @@ 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_private = to_via_drm_priv(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_private, true);
- via_tmds_io_pad_setting(dev_private,
- enc->di_port, true);
+ via_tmds_power(dev_priv, true);
+ via_tmds_io_pad_setting(dev_priv, enc->di_port, true);
break;
case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_OFF:
- via_tmds_power(dev_private, false);
- via_tmds_io_pad_setting(dev_private,
- enc->di_port, false);
+ via_tmds_power(dev_priv, false);
+ via_tmds_io_pad_setting(dev_priv, enc->di_port, false);
break;
default:
DRM_ERROR("Bad DPMS mode.");
@@ -244,12 +242,12 @@ 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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_tmds_power(dev_private, false);
- via_tmds_io_pad_setting(dev_private, enc->di_port, false);
+ via_tmds_power(dev_priv, false);
+ via_tmds_io_pad_setting(dev_priv, enc->di_port, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -259,12 +257,12 @@ 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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_tmds_power(dev_private, true);
- via_tmds_io_pad_setting(dev_private, enc->di_port, true);
+ via_tmds_power(dev_priv, true);
+ via_tmds_io_pad_setting(dev_priv, enc->di_port, true);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -278,15 +276,15 @@ 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_private = to_via_drm_priv(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_private);
- via_tmds_sync_polarity(dev_private, adjusted_mode->flags);
- via_tmds_display_source(dev_private, iga->index);
+ via_tmds_init_reg(dev_priv);
+ via_tmds_sync_polarity(dev_priv, adjusted_mode->flags);
+ via_tmds_display_source(dev_priv, iga->index);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -296,12 +294,12 @@ 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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- via_tmds_power(dev_private, false);
- via_tmds_io_pad_setting(dev_private, enc->di_port, false);
+ via_tmds_power(dev_priv, false);
+ via_tmds_io_pad_setting(dev_priv, enc->di_port, false);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -406,7 +404,7 @@ static const struct drm_connector_helper_funcs via_dvi_connector_helper_funcs =
void via_tmds_probe(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
u16 chipset = pdev->device;
u8 sr13, sr5a;
@@ -438,60 +436,57 @@ void via_tmds_probe(struct drm_device *dev)
* VIA Technologies NanoBook reference design based products
* have their pin strappings set to a wrong setting to communicate
* the presence of DVI, so it requires special handling here. */
- if (dev_private->is_via_nanobook) {
- dev_private->int_tmds_presence = true;
- dev_private->int_tmds_di_port =
- VIA_DI_PORT_TMDS;
- dev_private->int_tmds_i2c_bus = VIA_I2C_BUS2;
- dev_private->mapped_i2c_bus |= VIA_I2C_BUS2;
+ if (dev_priv->is_via_nanobook) {
+ dev_priv->int_tmds_presence = true;
+ 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) "
"transmitter detected.\n");
} else if (((!(sr13 & BIT(7))) && (sr13 & BIT(6))) ||
((sr13 & BIT(7)) && (sr13 & BIT(6)))) {
- dev_private->int_tmds_presence = true;
- dev_private->int_tmds_di_port =
- VIA_DI_PORT_TMDS;
- dev_private->int_tmds_i2c_bus = VIA_I2C_BUS2;
- dev_private->mapped_i2c_bus |= VIA_I2C_BUS2;
+ dev_priv->int_tmds_presence = true;
+ 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) "
"transmitter detected via pin "
"strapping.\n");
} else {
- dev_private->int_tmds_presence = false;
- dev_private->int_tmds_di_port =
- VIA_DI_PORT_NONE;
- dev_private->int_tmds_i2c_bus = VIA_I2C_NONE;
+ dev_priv->int_tmds_presence = false;
+ dev_priv->int_tmds_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_tmds_i2c_bus = VIA_I2C_NONE;
}
break;
default:
- dev_private->int_tmds_presence = false;
- dev_private->int_tmds_di_port = VIA_DI_PORT_NONE;
- dev_private->int_tmds_i2c_bus = VIA_I2C_NONE;
+ dev_priv->int_tmds_presence = false;
+ dev_priv->int_tmds_di_port = VIA_DI_PORT_NONE;
+ dev_priv->int_tmds_i2c_bus = VIA_I2C_NONE;
break;
}
DRM_DEBUG_KMS("int_tmds_presence: %x\n",
- dev_private->int_tmds_presence);
+ dev_priv->int_tmds_presence);
DRM_DEBUG_KMS("int_tmds_di_port: 0x%08x\n",
- dev_private->int_tmds_di_port);
+ dev_priv->int_tmds_di_port);
DRM_DEBUG_KMS("int_tmds_i2c_bus: 0x%08x\n",
- dev_private->int_tmds_i2c_bus);
+ dev_priv->int_tmds_i2c_bus);
DRM_DEBUG_KMS("mapped_i2c_bus: 0x%08x\n",
- dev_private->mapped_i2c_bus);
+ dev_priv->mapped_i2c_bus);
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
void via_tmds_init(struct drm_device *dev)
{
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct via_connector *con;
struct via_encoder *enc;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if (!dev_private->int_tmds_presence) {
+ if (!dev_priv->int_tmds_presence) {
goto exit;
}
@@ -510,10 +505,10 @@ void via_tmds_init(struct drm_device *dev)
enc->base.possible_crtcs = BIT(1) | BIT(0);
enc->base.possible_clones = 0;
- enc->di_port = dev_private->int_tmds_di_port;
+ enc->di_port = dev_priv->int_tmds_di_port;
/* Increment the number of DVI connectors. */
- dev_private->number_dvi++;
+ dev_priv->number_dvi++;
con = &enc->cons[0];
@@ -522,7 +517,7 @@ void via_tmds_init(struct drm_device *dev)
drm_connector_helper_add(&con->base, &via_dvi_connector_helper_funcs);
drm_connector_register(&con->base);
- con->i2c_bus = dev_private->int_tmds_i2c_bus;
+ con->i2c_bus = dev_priv->int_tmds_i2c_bus;
con->base.doublescan_allowed = false;
con->base.interlace_allowed = true;
INIT_LIST_HEAD(&con->props);
@@ -538,50 +533,46 @@ exit:
void openchrome_ext_dvi_probe(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
u16 chipset = pdev->device;
u8 sr12, sr13;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- dev_private->ext_tmds_presence = false;
- dev_private->ext_tmds_i2c_bus = VIA_I2C_NONE;
- dev_private->ext_tmds_transmitter = VIA_TMDS_NONE;
+ dev_priv->ext_tmds_presence = false;
+ dev_priv->ext_tmds_i2c_bus = VIA_I2C_NONE;
+ dev_priv->ext_tmds_transmitter = VIA_TMDS_NONE;
- if ((!dev_private->ext_tmds_presence) &&
- (!(dev_private->mapped_i2c_bus & VIA_I2C_BUS2))) {
+ if ((!dev_priv->ext_tmds_presence) &&
+ (!(dev_priv->mapped_i2c_bus & VIA_I2C_BUS2))) {
i2c_bus = via_find_ddc_bus(0x31);
if (openchrome_vt1632_probe(i2c_bus)) {
- dev_private->ext_tmds_presence = true;
- dev_private->ext_tmds_i2c_bus = VIA_I2C_BUS2;
- dev_private->ext_tmds_transmitter =
- VIA_TMDS_VT1632;
- dev_private->mapped_i2c_bus |= VIA_I2C_BUS2;
+ dev_priv->ext_tmds_presence = true;
+ 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 (openchrome_sii164_probe(i2c_bus)) {
- dev_private->ext_tmds_presence = true;
- dev_private->ext_tmds_i2c_bus = VIA_I2C_BUS2;
- dev_private->ext_tmds_transmitter =
- VIA_TMDS_SII164;
- dev_private->mapped_i2c_bus |= VIA_I2C_BUS2;
+ dev_priv->ext_tmds_presence = true;
+ dev_priv->ext_tmds_i2c_bus = VIA_I2C_BUS2;
+ dev_priv->ext_tmds_transmitter = VIA_TMDS_SII164;
+ dev_priv->mapped_i2c_bus |= VIA_I2C_BUS2;
}
}
- if ((!(dev_private->ext_tmds_presence)) &&
- (!(dev_private->mapped_i2c_bus & VIA_I2C_BUS4))) {
+ if ((!(dev_priv->ext_tmds_presence)) &&
+ (!(dev_priv->mapped_i2c_bus & VIA_I2C_BUS4))) {
i2c_bus = via_find_ddc_bus(0x2c);
if (openchrome_vt1632_probe(i2c_bus)) {
- dev_private->ext_tmds_presence = true;
- dev_private->ext_tmds_i2c_bus = VIA_I2C_BUS4;
- dev_private->ext_tmds_transmitter =
- VIA_TMDS_VT1632;
- dev_private->mapped_i2c_bus |= VIA_I2C_BUS4;
+ dev_priv->ext_tmds_presence = true;
+ 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 (openchrome_sii164_probe(i2c_bus)) {
- dev_private->ext_tmds_presence = true;
- dev_private->ext_tmds_i2c_bus = VIA_I2C_BUS4;
- dev_private->ext_tmds_transmitter =
- VIA_TMDS_SII164;
- dev_private->mapped_i2c_bus |= VIA_I2C_BUS4;
+ dev_priv->ext_tmds_presence = true;
+ dev_priv->ext_tmds_i2c_bus = VIA_I2C_BUS4;
+ dev_priv->ext_tmds_transmitter = VIA_TMDS_SII164;
+ dev_priv->mapped_i2c_bus |= VIA_I2C_BUS4;
}
}
@@ -590,7 +581,7 @@ void openchrome_ext_dvi_probe(struct drm_device *dev)
DRM_DEBUG_KMS("SR12: 0x%02x\n", sr12);
DRM_DEBUG_KMS("SR13: 0x%02x\n", sr13);
- if (dev_private->ext_tmds_presence) {
+ if (dev_priv->ext_tmds_presence) {
switch (chipset) {
case PCI_DEVICE_ID_VIA_CLE266:
@@ -599,18 +590,15 @@ void openchrome_ext_dvi_probe(struct drm_device *dev)
* capture device
* 1: Flat panel */
if (!(sr12 & BIT(4))) {
- dev_private->ext_tmds_di_port =
- VIA_DI_PORT_DIP0;
+ dev_priv->ext_tmds_di_port = VIA_DI_PORT_DIP0;
/* 3C5.12[5] - FPD18 pin strapping
* 0: TMDS transmitter (DVI)
* 1: TV encoder */
} else if (!(sr12 & BIT(5))) {
- dev_private->ext_tmds_di_port =
- VIA_DI_PORT_DIP1;
+ dev_priv->ext_tmds_di_port = VIA_DI_PORT_DIP1;
} else {
- dev_private->ext_tmds_di_port =
- VIA_DI_PORT_NONE;
+ dev_priv->ext_tmds_di_port = VIA_DI_PORT_NONE;
}
break;
@@ -627,11 +615,9 @@ void openchrome_ext_dvi_probe(struct drm_device *dev)
* 0: TMDS transmitter (DVI)
* 1: TV encoder */
if ((sr12 & BIT(6)) && (!(sr12 & BIT(5)))) {
- dev_private->ext_tmds_di_port =
- VIA_DI_PORT_DVP0;
+ dev_priv->ext_tmds_di_port = VIA_DI_PORT_DVP0;
} else {
- dev_private->ext_tmds_di_port =
- VIA_DI_PORT_DVP1;
+ dev_priv->ext_tmds_di_port = VIA_DI_PORT_DVP1;
}
break;
@@ -647,11 +633,9 @@ void openchrome_ext_dvi_probe(struct drm_device *dev)
* 0: TMDS transmitter (DVI)
* 1: TV encoder */
if ((sr12 & BIT(6)) && (!(sr12 & BIT(5)))) {
- dev_private->ext_tmds_di_port =
- VIA_DI_PORT_DVP0;
+ dev_priv->ext_tmds_di_port = VIA_DI_PORT_DVP0;
} else {
- dev_private->ext_tmds_di_port =
- VIA_DI_PORT_NONE;
+ dev_priv->ext_tmds_di_port = VIA_DI_PORT_NONE;
}
break;
@@ -659,12 +643,10 @@ void openchrome_ext_dvi_probe(struct drm_device *dev)
case PCI_DEVICE_ID_VIA_VT1122:
case PCI_DEVICE_ID_VIA_VX875:
case PCI_DEVICE_ID_VIA_VX900_VGA:
- dev_private->ext_tmds_di_port =
- VIA_DI_PORT_DVP1;
+ dev_priv->ext_tmds_di_port = VIA_DI_PORT_DVP1;
break;
default:
- dev_private->ext_tmds_di_port =
- VIA_DI_PORT_NONE;
+ dev_priv->ext_tmds_di_port = VIA_DI_PORT_NONE;
break;
}
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index cc322f4e2618..7555268b5041 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -145,7 +145,7 @@ static void openchrome_bo_delete_mem_notify(struct ttm_buffer_object *bo)
static int openchrome_bo_io_mem_reserve(struct ttm_device *bdev,
struct ttm_resource *mem)
{
- struct via_drm_priv *dev_private = container_of(bdev,
+ struct via_drm_priv *dev_priv = container_of(bdev,
struct via_drm_priv, bdev);
int ret = 0;
@@ -155,7 +155,7 @@ static int openchrome_bo_io_mem_reserve(struct ttm_device *bdev,
case TTM_PL_SYSTEM:
break;
case TTM_PL_VRAM:
- mem->bus.offset = dev_private->vram_start +
+ mem->bus.offset = dev_priv->vram_start +
(mem->start << PAGE_SHIFT);
mem->bus.is_iomem = true;
break;
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index 6cfe98367772..12d806bb9abb 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -155,7 +155,7 @@ static void openchrome_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -179,15 +179,15 @@ static void openchrome_vt1632_dpms(struct drm_encoder *encoder, int mode)
switch (mode) {
case DRM_MODE_DPMS_ON:
openchrome_vt1632_power(i2c_bus, true);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, true);
+ openchrome_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:
openchrome_vt1632_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, false);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port,
+ false);
break;
default:
DRM_ERROR("Bad DPMS mode.");
@@ -218,7 +218,7 @@ static void openchrome_vt1632_mode_set(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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -238,19 +238,18 @@ static void openchrome_vt1632_mode_set(struct drm_encoder *encoder,
goto exit;
}
- openchrome_transmitter_clock_drive_strength(dev_private,
- enc->di_port, 0x03);
- openchrome_transmitter_data_drive_strength(dev_private,
- enc->di_port, 0x03);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, true);
+ openchrome_transmitter_clock_drive_strength(dev_priv, enc->di_port,
+ 0x03);
+ openchrome_transmitter_data_drive_strength(dev_priv, enc->di_port,
+ 0x03);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, true);
openchrome_vt1632_display_registers(i2c_bus);
openchrome_vt1632_init_registers(i2c_bus);
openchrome_vt1632_display_registers(i2c_bus);
- openchrome_transmitter_display_source(dev_private,
- enc->di_port, iga->index);
+ openchrome_transmitter_display_source(dev_priv, enc->di_port,
+ iga->index);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -261,7 +260,7 @@ static void openchrome_vt1632_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -282,8 +281,7 @@ static void openchrome_vt1632_prepare(struct drm_encoder *encoder)
}
openchrome_vt1632_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, false);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, false);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -293,7 +291,7 @@ static void openchrome_vt1632_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -314,8 +312,7 @@ static void openchrome_vt1632_commit(struct drm_encoder *encoder)
}
openchrome_vt1632_power(i2c_bus, true);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, true);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, true);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -326,7 +323,7 @@ static void openchrome_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_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -347,8 +344,7 @@ static void openchrome_vt1632_disable(struct drm_encoder *encoder)
}
openchrome_vt1632_power(i2c_bus, false);
- openchrome_transmitter_io_pad_state(dev_private,
- enc->di_port, false);
+ openchrome_transmitter_io_pad_state(dev_priv, enc->di_port, false);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
@@ -546,11 +542,11 @@ void openchrome_vt1632_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
- struct via_drm_priv *dev_private = to_via_drm_priv(dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if (!dev_private->ext_tmds_presence) {
+ if (!dev_priv->ext_tmds_presence) {
goto exit;
}
@@ -568,11 +564,11 @@ void openchrome_vt1632_init(struct drm_device *dev)
enc->base.possible_crtcs = BIT(1) | BIT(0);
enc->base.possible_clones = 0;
- enc->i2c_bus = dev_private->ext_tmds_i2c_bus;
- enc->di_port = dev_private->ext_tmds_di_port;
+ enc->i2c_bus = dev_priv->ext_tmds_i2c_bus;
+ enc->di_port = dev_priv->ext_tmds_di_port;
/* Increment the number of DVI connectors. */
- dev_private->number_dvi++;
+ dev_priv->number_dvi++;
con = &enc->cons[0];
@@ -585,7 +581,7 @@ void openchrome_vt1632_init(struct drm_device *dev)
con->base.doublescan_allowed = false;
con->base.interlace_allowed = false;
- con->i2c_bus = dev_private->ext_tmds_i2c_bus;
+ con->i2c_bus = dev_priv->ext_tmds_i2c_bus;
INIT_LIST_HEAD(&con->props);
drm_connector_attach_encoder(&con->base, &enc->base);
commit c7176fe5941bee26ec08fa750ce1cc11174304ff
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jun 3 19:16:42 2022 -0500
drm/openchrome: Rename device private struct to via_drm_priv{}
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_analog.c b/drivers/gpu/drm/openchrome/openchrome_analog.c
index d21e9966a6ee..a7346ed631fb 100644
--- a/drivers/gpu/drm/openchrome/openchrome_analog.c
+++ b/drivers/gpu/drm/openchrome/openchrome_analog.c
@@ -36,7 +36,7 @@
/*
* Enables or disables analog (VGA) output.
*/
-static void via_analog_power(struct openchrome_drm_private *dev_private,
+static void via_analog_power(struct via_drm_priv *dev_private,
bool outputState)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -52,9 +52,8 @@ static void via_analog_power(struct openchrome_drm_private *dev_private,
/*
* Set analog (VGA) sync polarity.
*/
-static void via_analog_sync_polarity(
- struct openchrome_drm_private *dev_private,
- unsigned int flags)
+static void via_analog_sync_polarity(struct via_drm_priv *dev_private,
+ unsigned int flags)
{
u8 syncPolarity = 0x00;
@@ -80,9 +79,8 @@ static void via_analog_sync_polarity(
/*
* Sets analog (VGA) display source.
*/
-static void via_analog_display_source(
- struct openchrome_drm_private *dev_private,
- int index)
+static void via_analog_display_source(struct via_drm_priv *dev_private,
+ int index)
{
u8 displaySource = index;
@@ -109,8 +107,7 @@ static void
via_analog_dpms(struct drm_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -161,8 +158,7 @@ via_analog_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -177,8 +173,7 @@ static void
via_analog_prepare(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -194,8 +189,7 @@ static void
via_analog_commit(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -211,8 +205,7 @@ static void
via_analog_disable(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -357,8 +350,7 @@ static const struct drm_connector_helper_funcs via_analog_connector_helper_funcs
void via_analog_probe(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev);
u16 chipset = pdev->device;
u8 sr13, sr5a;
@@ -413,8 +405,7 @@ void via_analog_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
enc = kzalloc(sizeof(*enc) + sizeof(*con), GFP_KERNEL);
if (!enc) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_clocks.c b/drivers/gpu/drm/openchrome/openchrome_clocks.c
index 15cfcdb8cd16..2994232044ad 100644
--- a/drivers/gpu/drm/openchrome/openchrome_clocks.c
+++ b/drivers/gpu/drm/openchrome/openchrome_clocks.c
@@ -199,8 +199,7 @@ via_set_vclock(struct drm_crtc *crtc, u32 clk)
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
unsigned long max_loop = 50, i = 0;
if (!iga->index) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 8c2c5b81a8a2..021671a70864 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -95,9 +95,8 @@ static void via_iga_common_init(void __iomem *regs)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_iga1_set_color_depth(
- struct openchrome_drm_private *dev_private,
- u8 depth)
+static void via_iga1_set_color_depth(struct via_drm_priv *dev_private,
+ u8 depth)
{
u8 value;
@@ -140,9 +139,8 @@ static void via_iga1_set_color_depth(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_iga2_set_color_depth(
- struct openchrome_drm_private *dev_private,
- u8 depth)
+static void via_iga2_set_color_depth(struct via_drm_priv *dev_private,
+ u8 depth)
{
u8 value;
@@ -187,8 +185,7 @@ static int openchrome_gamma_set(struct drm_crtc *crtc,
{
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
int end = (size > 256) ? 256 : size, i;
@@ -353,8 +350,7 @@ static const struct drm_crtc_funcs openchrome_drm_crtc_funcs = {
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
};
-static void via_load_vpit_regs(
- struct openchrome_drm_private *dev_private)
+static void via_load_vpit_regs(struct via_drm_priv *dev_private)
{
u8 ar[] = {0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07,
@@ -389,12 +385,11 @@ static void via_load_vpit_regs(
vga_w(VGABASE, VGA_ATT_W, BIT(5));
}
-static int via_iga1_display_fifo_regs(
- struct drm_device *dev,
- struct openchrome_drm_private *dev_private,
- struct via_crtc *iga,
- struct drm_display_mode *mode,
- struct drm_framebuffer *fb)
+static int via_iga1_display_fifo_regs(struct drm_device *dev,
+ struct via_drm_priv *dev_private,
+ struct via_crtc *iga,
+ struct drm_display_mode *mode,
+ struct drm_framebuffer *fb)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
u32 reg_value;
@@ -792,12 +787,11 @@ exit:
return ret;
}
-static int via_iga2_display_fifo_regs(
- struct drm_device *dev,
- struct openchrome_drm_private *dev_private,
- struct via_crtc *iga,
- struct drm_display_mode *mode,
- struct drm_framebuffer *fb)
+static int via_iga2_display_fifo_regs(struct drm_device *dev,
+ struct via_drm_priv *dev_private,
+ struct via_crtc *iga,
+ struct drm_display_mode *mode,
+ struct drm_framebuffer *fb)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
u32 reg_value;
@@ -1114,8 +1108,7 @@ via_load_crtc_pixel_timing(struct drm_crtc *crtc,
{
struct drm_device *dev = crtc->dev;
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
u32 reg_value = 0;
reg_value = IGA1_PIXELTIMING_HOR_TOTAL_FORMULA(mode->crtc_htotal);
@@ -1191,8 +1184,7 @@ via_load_crtc_timing(struct via_crtc *iga, struct drm_display_mode *mode)
{
struct drm_device *dev = iga->base.dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
u32 reg_value = 0;
if (!iga->index) {
@@ -1290,8 +1282,7 @@ via_set_scale_path(struct drm_crtc *crtc, u32 scale_type)
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
u8 reg_cr_fd = vga_rcrt(VGABASE, 0xFD);
if (!iga->index)
@@ -1336,8 +1327,7 @@ via_disable_iga_scaling(struct drm_crtc *crtc)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
if (iga->index) {
/* IGA2 scalings disable */
@@ -1384,8 +1374,7 @@ via_set_iga_scale_function(struct drm_crtc *crtc, u32 scale_type)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
if (!(scale_type & (VIA_SHRINK + VIA_EXPAND)))
return false;
@@ -1468,11 +1457,10 @@ via_set_iga_scale_function(struct drm_crtc *crtc, u32 scale_type)
* 2. load scale factors into registers
* 3. enable H or V scale ( set CRA2 bit7 or bit3 )
*/
-bool via_load_iga_scale_factor_regs(
- struct openchrome_drm_private *dev_private,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode,
- u32 scale_type, u32 is_hor_or_ver)
+bool via_load_iga_scale_factor_regs(struct via_drm_priv *dev_private,
+ struct drm_display_mode *mode,
+ struct drm_display_mode *adjusted_mode,
+ u32 scale_type, u32 is_hor_or_ver)
{
u32 dst_hor_regs = adjusted_mode->crtc_hdisplay;
u32 dst_ver_regs = adjusted_mode->crtc_vdisplay;
@@ -1603,8 +1591,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
&crtc->state->adjusted_mode;
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
u8 reg_value = 0;
int ret;
@@ -1813,8 +1800,7 @@ static void openchrome_crtc_helper_atomic_enable(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{
struct drm_device *dev = crtc->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -1833,8 +1819,7 @@ static void openchrome_crtc_helper_atomic_disable(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{
struct drm_device *dev = crtc->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -1864,8 +1849,7 @@ static int openchrome_primary_atomic_check(struct drm_plane *plane,
struct drm_crtc_state *new_crtc_state;
struct drm_device *dev = plane->dev;
struct drm_framebuffer *fb = new_plane_state->fb;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
uint32_t frame_buffer_size;
int ret = 0;
@@ -1922,8 +1906,7 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
uint32_t addr;
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct drm_device *dev = crtc->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
struct openchrome_bo *bo;
@@ -2063,10 +2046,9 @@ static const struct drm_plane_funcs openchrome_primary_drm_plane_funcs = {
drm_atomic_helper_plane_destroy_state,
};
-static void openchrome_crtc_param_init(
- struct openchrome_drm_private *dev_private,
- struct drm_crtc *crtc,
- uint32_t index)
+static void openchrome_crtc_param_init(struct via_drm_priv *dev_private,
+ struct drm_crtc *crtc,
+ uint32_t index)
{
struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -2258,7 +2240,7 @@ static const uint32_t openchrome_primary_formats[] = {
DRM_FORMAT_RGB332,
};
-int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
+int openchrome_crtc_init(struct via_drm_priv *dev_private,
uint32_t index)
{
struct drm_device *dev = &dev_private->dev;
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index 37d4650f0bf4..99b815c4464f 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -57,8 +57,7 @@ static void openchrome_hide_cursor(struct drm_crtc *crtc)
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
uint32_t temp;
switch (pdev->device) {
@@ -90,8 +89,7 @@ static void openchrome_show_cursor(struct drm_crtc *crtc)
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_VT3157:
@@ -168,8 +166,7 @@ static void openchrome_cursor_address(struct drm_crtc *crtc,
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_VT3157:
@@ -209,8 +206,7 @@ static void openchrome_set_hi_location(struct drm_crtc *crtc,
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
uint32_t location_x = 0, location_y = 0;
uint32_t offset_x = 0, offset_y = 0;
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 311e191fe2c3..f111df644424 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -91,8 +91,7 @@ static void
via_init_td_timing_regs(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
unsigned int td_timer[4] = { 500, 50, 0, 510 }, i;
struct vga_registers timings;
u32 reg_value;
@@ -128,8 +127,7 @@ int
via_modeset_init(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
uint32_t i;
int ret = 0;
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index d20da99bc515..ef37a84025bf 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -90,8 +90,7 @@ static int openchrome_driver_dumb_create(
struct drm_device *dev,
struct drm_mode_create_dumb *args)
{
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct openchrome_bo *bo;
uint32_t handle, pitch;
uint64_t size;
@@ -200,7 +199,7 @@ static int openchrome_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct drm_device *dev;
- struct openchrome_drm_private *dev_private;
+ struct via_drm_priv *dev_private;
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -218,7 +217,7 @@ static int openchrome_pci_probe(struct pci_dev *pdev,
dev_private = devm_drm_dev_alloc(&pdev->dev,
&openchrome_driver,
- struct openchrome_drm_private,
+ struct via_drm_priv,
dev);
if (IS_ERR(dev_private)) {
ret = PTR_ERR(dev_private);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index e1081359d660..ed246320bcbc 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -203,7 +203,7 @@ enum via_engine {
VIA_ENG_H6S2
};
-struct openchrome_drm_private {
+struct via_drm_priv {
struct drm_device dev;
struct ttm_device bdev;
@@ -312,7 +312,10 @@ struct openchrome_drm_private {
};
-#define to_openchrome_private(x) container_of(x, struct openchrome_drm_private, dev)
+/*
+ * Shortcut for using container_of macro.
+ */
+#define to_via_drm_priv(x) container_of(x, struct via_drm_priv, dev)
/* VIA MMIO register access */
@@ -352,18 +355,16 @@ extern int openchrome_driver_num_ioctls;
extern struct ttm_device_funcs openchrome_bo_driver;
-int openchrome_vram_detect(struct openchrome_drm_private *dev_private);
-int openchrome_vram_init(struct openchrome_drm_private *dev_private);
-void openchrome_vram_fini(struct openchrome_drm_private *dev_private);
-int openchrome_mmio_init(struct openchrome_drm_private *dev_private);
-void openchrome_mmio_fini(struct openchrome_drm_private *dev_private);
-void openchrome_graphics_unlock(
- struct openchrome_drm_private *dev_private);
-void chip_revision_info(struct openchrome_drm_private *dev_private);
-int openchrome_device_init(struct openchrome_drm_private *dev_private);
-void openchrome_device_fini(struct openchrome_drm_private *dev_private);
-void openchrome_mode_config_init(
- struct openchrome_drm_private *dev_private);
+int openchrome_vram_detect(struct via_drm_priv *dev_private);
+int openchrome_vram_init(struct via_drm_priv *dev_private);
+void openchrome_vram_fini(struct via_drm_priv *dev_private);
+int openchrome_mmio_init(struct via_drm_priv *dev_private);
+void openchrome_mmio_fini(struct via_drm_priv *dev_private);
+void openchrome_graphics_unlock(struct via_drm_priv *dev_private);
+void chip_revision_info(struct via_drm_priv *dev_private);
+int openchrome_device_init(struct via_drm_priv *dev_private);
+void openchrome_device_fini(struct via_drm_priv *dev_private);
+void openchrome_mode_config_init(struct via_drm_priv *dev_private);
int openchrome_drm_init(struct drm_device *dev);
void openchrome_drm_fini(struct drm_device *dev);
@@ -383,21 +384,21 @@ int openchrome_bo_create(struct drm_device *dev,
bool kmap,
struct openchrome_bo **bo_ptr);
void openchrome_bo_destroy(struct openchrome_bo *bo, bool kmap);
-int openchrome_mm_init(struct openchrome_drm_private *dev_private);
-void openchrome_mm_fini(struct openchrome_drm_private *dev_private);
+int openchrome_mm_init(struct via_drm_priv *dev_private);
+void openchrome_mm_fini(struct via_drm_priv *dev_private);
-void openchrome_transmitter_io_pad_state(
- struct openchrome_drm_private *dev_private,
- uint32_t di_port, bool io_pad_on);
+void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_private,
+ uint32_t di_port,
+ bool io_pad_on);
void openchrome_transmitter_clock_drive_strength(
- struct openchrome_drm_private *dev_private,
- u32 di_port, u8 drive_strength);
+ struct via_drm_priv *dev_private,
+ u32 di_port, u8 drive_strength);
void openchrome_transmitter_data_drive_strength(
- struct openchrome_drm_private *dev_private,
- u32 di_port, u8 drive_strength);
+ struct via_drm_priv *dev_private,
+ u32 di_port, u8 drive_strength);
void openchrome_transmitter_display_source(
- struct openchrome_drm_private *dev_private,
- u32 di_port, int index);
+ struct via_drm_priv *dev_private,
+ u32 di_port, int index);
extern const struct drm_plane_helper_funcs
openchrome_cursor_drm_plane_helper_funcs;
@@ -417,7 +418,7 @@ void via_i2c_readbytes(struct i2c_adapter *adapter,
void via_i2c_writebytes(struct i2c_adapter *adapter,
u8 slave_addr, char offset,
u8 *data, unsigned int size);
-void via_i2c_reg_init(struct openchrome_drm_private *dev_private);
+void via_i2c_reg_init(struct via_drm_priv *dev_private);
int via_i2c_init(struct drm_device *dev);
void via_i2c_exit(void);
@@ -428,7 +429,7 @@ void via_set_vclock(struct drm_crtc *crtc, u32 clk);
/* crtc */
void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
struct drm_display_mode *mode);
-int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
+int openchrome_crtc_init(struct via_drm_priv *dev_private,
uint32_t index);
/* encoders */
diff --git a/drivers/gpu/drm/openchrome/openchrome_encoder.c b/drivers/gpu/drm/openchrome/openchrome_encoder.c
index 583107953146..eae49c72cffa 100644
--- a/drivers/gpu/drm/openchrome/openchrome_encoder.c
+++ b/drivers/gpu/drm/openchrome/openchrome_encoder.c
@@ -33,9 +33,9 @@
#include "openchrome_drv.h"
-void openchrome_transmitter_io_pad_state(
- struct openchrome_drm_private *dev_private,
- uint32_t di_port, bool io_pad_on)
+void openchrome_transmitter_io_pad_state(struct via_drm_priv *dev_private,
+ uint32_t di_port,
+ bool io_pad_on)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -86,8 +86,8 @@ void openchrome_transmitter_io_pad_state(
}
void openchrome_transmitter_clock_drive_strength(
- struct openchrome_drm_private *dev_private,
- u32 di_port, u8 drive_strength)
+ struct via_drm_priv *dev_private,
+ u32 di_port, u8 drive_strength)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -108,8 +108,8 @@ void openchrome_transmitter_clock_drive_strength(
}
void openchrome_transmitter_data_drive_strength(
- struct openchrome_drm_private *dev_private,
- u32 di_port, u8 drive_strength)
+ struct via_drm_priv *dev_private,
+ u32 di_port, u8 drive_strength)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -129,9 +129,8 @@ void openchrome_transmitter_data_drive_strength(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_transmitter_display_source(
- struct openchrome_drm_private *dev_private,
- u32 di_port, int index)
+void openchrome_transmitter_display_source(struct via_drm_priv *dev_private,
+ u32 di_port, int index)
{
u8 display_source = index & 0x01;
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index 57d0afdc464e..a9e396d3569d 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -137,8 +137,8 @@ via_centering_timing(const struct drm_display_mode *mode,
}
static void via_fp_castle_rock_soft_power_seq(
- struct openchrome_drm_private *dev_private,
- bool power_state)
+ struct via_drm_priv *dev_private,
+ bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -189,9 +189,8 @@ static void via_fp_castle_rock_soft_power_seq(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_primary_soft_power_seq(
- struct openchrome_drm_private *dev_private,
- bool power_state)
+static void via_fp_primary_soft_power_seq(struct via_drm_priv *dev_private,
+ bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -257,9 +256,8 @@ static void via_fp_primary_soft_power_seq(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_secondary_soft_power_seq(
- struct openchrome_drm_private *dev_private,
- bool power_state)
+static void via_fp_secondary_soft_power_seq(struct via_drm_priv *dev_private,
+ bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -325,9 +323,8 @@ static void via_fp_secondary_soft_power_seq(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_primary_hard_power_seq(
- struct openchrome_drm_private *dev_private,
- bool power_state)
+static void via_fp_primary_hard_power_seq(struct via_drm_priv *dev_private,
+ bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -357,10 +354,9 @@ static void via_fp_primary_hard_power_seq(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_power(
- struct openchrome_drm_private *dev_private,
- unsigned short device,
- u32 di_port, bool power_state)
+static void via_fp_power(struct via_drm_priv *dev_private,
+ unsigned short device,
+ u32 di_port, bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -412,9 +408,8 @@ static void via_fp_power(
/*
* Sets flat panel I/O pad state.
*/
-static void via_fp_io_pad_setting(
- struct openchrome_drm_private *dev_private,
- u32 di_port, bool io_pad_on)
+static void via_fp_io_pad_setting(struct via_drm_priv *dev_private,
+ u32 di_port, bool io_pad_on)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -456,9 +451,8 @@ static void via_fp_io_pad_setting(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_format(
- struct openchrome_drm_private *dev_private,
- u32 di_port, u8 format)
+static void via_fp_format(struct via_drm_priv *dev_private,
+ u32 di_port, u8 format)
{
u8 temp = format & 0x01;
@@ -483,9 +477,8 @@ static void via_fp_format(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_output_format(
- struct openchrome_drm_private *dev_private,
- u32 di_port, u8 output_format)
+static void via_fp_output_format(struct via_drm_priv *dev_private,
+ u32 di_port, u8 output_format)
{
u8 temp = output_format & 0x01;
@@ -510,9 +503,8 @@ static void via_fp_output_format(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_fp_dithering(
- struct openchrome_drm_private *dev_private,
- u32 di_port, bool dithering)
+static void via_fp_dithering(struct via_drm_priv *dev_private,
+ u32 di_port, bool dithering)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -538,9 +530,8 @@ static void via_fp_dithering(
/*
* Sets flat panel display source.
*/
-static void via_fp_display_source(
- struct openchrome_drm_private *dev_private,
- u32 di_port, int index)
+static void via_fp_display_source(struct via_drm_priv *dev_private,
+ u32 di_port, int index)
{
u8 display_source = index & 0x01;
@@ -593,8 +584,7 @@ static void via_fp_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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -690,8 +680,7 @@ static void via_fp_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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -710,8 +699,7 @@ static void via_fp_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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -732,8 +720,7 @@ via_fp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *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);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -778,8 +765,7 @@ static void via_fp_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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -812,8 +798,7 @@ via_fp_detect(struct drm_connector *connector, bool force)
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_connector *con = container_of(connector,
struct via_connector, base);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
enum drm_connector_status ret = connector_status_disconnected;
struct i2c_adapter *i2c_bus;
struct edid *edid = NULL;
@@ -939,8 +924,7 @@ via_fp_get_modes(struct drm_connector *connector)
{
struct via_connector *con = container_of(connector, struct via_connector, base);
struct drm_device *dev = connector->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
struct edid *edid = NULL;
struct drm_display_mode *native_mode = NULL;
@@ -1093,8 +1077,7 @@ struct drm_connector_helper_funcs via_fp_connector_helper_funcs = {
void via_fp_probe(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct drm_connector connector;
struct i2c_adapter *i2c_bus;
struct edid *edid;
@@ -1340,8 +1323,7 @@ void via_fp_probe(struct drm_device *dev)
void via_fp_init(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct via_connector *con;
struct via_encoder *enc;
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index 4156af134b81..b5f6e714dba9 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -52,8 +52,7 @@ static void
via_hdmi_enc_dpms(struct drm_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
switch (mode) {
case DRM_MODE_DPMS_SUSPEND:
@@ -163,8 +162,7 @@ via_hdmi_native_mode_set(struct via_crtc *iga, struct drm_display_mode *mode,
bool audio_off)
{
struct drm_device *dev = iga->base.dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
u32 reg_c280, reg_c284;
int max_packet, delay;
u8 value = BIT(0);
@@ -254,8 +252,7 @@ via_hdmi_enc_mode_set(struct drm_encoder *encoder,
struct drm_connector *connector = NULL, *con;
struct drm_device *dev = encoder->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
list_for_each_entry(con, &dev->mode_config.connector_list, head) {
if (encoder == con->encoder) {
@@ -394,9 +391,9 @@ static const struct drm_encoder_helper_funcs via_hdmi_enc_helper_funcs = {
};
static unsigned int via_check_hdmi_i2c_status(
- struct openchrome_drm_private *dev_private,
- unsigned int check_bits,
- unsigned int condition)
+ struct via_drm_priv *dev_private,
+ unsigned int check_bits,
+ unsigned int condition)
{
unsigned int status = true, max = 50, loop = 0;
@@ -421,9 +418,9 @@ static unsigned int via_check_hdmi_i2c_status(
}
unsigned int via_ddc_read_bytes_by_hdmi(
- struct openchrome_drm_private *dev_private,
- unsigned int offset,
- unsigned char *block)
+ struct via_drm_priv *dev_private,
+ unsigned int offset,
+ unsigned char *block)
{
unsigned int status = true, temp = 0, i;
@@ -504,8 +501,7 @@ via_hdmi_get_edid(struct drm_connector *connector)
{
bool print_bad_edid = !connector->bad_edid_counter || (drm_debug_enabled(DRM_UT_KMS));
struct drm_device *dev = connector->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct edid *edid = NULL;
int i, j = 0;
u8 *block;
@@ -597,8 +593,7 @@ static enum drm_connector_status
via_hdmi_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
enum drm_connector_status ret = connector_status_disconnected;
u32 mm_c730 = VIA_READ(0xc730) & 0xC0000000;
struct edid *edid = NULL;
diff --git a/drivers/gpu/drm/openchrome/openchrome_i2c.c b/drivers/gpu/drm/openchrome/openchrome_i2c.c
index 1c6385f55a01..2f743ebfc421 100644
--- a/drivers/gpu/drm/openchrome/openchrome_i2c.c
+++ b/drivers/gpu/drm/openchrome/openchrome_i2c.c
@@ -33,8 +33,7 @@ static void via_i2c_setsda(void *data, int state)
{
struct via_i2c_stuff *i2c = data;
struct drm_device *dev = i2c_get_adapdata(&i2c->adapter);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
u8 value, mask;
if (i2c->is_active == GPIO) {
@@ -52,8 +51,7 @@ static void via_i2c_setscl(void *data, int state)
{
struct via_i2c_stuff *i2c = data;
struct drm_device *dev = i2c_get_adapdata(&i2c->adapter);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
u8 value, mask;
if (i2c->is_active == GPIO) {
@@ -71,8 +69,7 @@ static int via_i2c_getsda(void *data)
{
struct via_i2c_stuff *i2c = data;
struct drm_device *dev = i2c_get_adapdata(&i2c->adapter);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
return vga_rseq(VGABASE, i2c->i2c_port) & BIT(2);
}
@@ -81,8 +78,7 @@ static int via_i2c_getscl(void *data)
{
struct via_i2c_stuff *i2c = data;
struct drm_device *dev = i2c_get_adapdata(&i2c->adapter);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
return vga_rseq(VGABASE, i2c->i2c_port) & BIT(3);
}
@@ -184,7 +180,7 @@ via_i2c_writebytes(struct i2c_adapter *adapter,
kfree(out_buf);
}
-void via_i2c_reg_init(struct openchrome_drm_private *dev_private)
+void via_i2c_reg_init(struct via_drm_priv *dev_private)
{
svga_wseq_mask(VGABASE, 0x31, 0x30, 0x30);
svga_wseq_mask(VGABASE, 0x26, 0x30, 0x30);
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index d252b3295c7e..deed4d06ce7e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -34,7 +34,7 @@
#include "openchrome_drv.h"
-static int cle266_mem_type(struct openchrome_drm_private *dev_private,
+static int cle266_mem_type(struct via_drm_priv *dev_private,
struct pci_dev *bridge)
{
u8 type, fsb, freq;
@@ -135,7 +135,7 @@ static int cle266_mem_type(struct openchrome_drm_private *dev_private,
return ret;
}
-static int km400_mem_type(struct openchrome_drm_private *dev_private,
+static int km400_mem_type(struct via_drm_priv *dev_private,
struct pci_dev *bridge)
{
u8 fsb, freq, rev;
@@ -317,7 +317,7 @@ static int km400_mem_type(struct openchrome_drm_private *dev_private,
return ret;
}
-static int p4m800_mem_type(struct openchrome_drm_private *dev_private,
+static int p4m800_mem_type(struct via_drm_priv *dev_private,
struct pci_bus *bus,
struct pci_dev *fn3)
{
@@ -385,7 +385,7 @@ static int p4m800_mem_type(struct openchrome_drm_private *dev_private,
return ret;
}
-static int km8xx_mem_type(struct openchrome_drm_private *dev_private)
+static int km8xx_mem_type(struct via_drm_priv *dev_private)
{
struct pci_dev *dram, *misc = NULL;
int ret = -ENXIO;
@@ -535,7 +535,7 @@ static int km8xx_mem_type(struct openchrome_drm_private *dev_private)
return ret;
}
-static int cn400_mem_type(struct openchrome_drm_private *dev_private,
+static int cn400_mem_type(struct via_drm_priv *dev_private,
struct pci_bus *bus,
struct pci_dev *fn3)
{
@@ -599,7 +599,7 @@ static int cn400_mem_type(struct openchrome_drm_private *dev_private,
return ret;
}
-static int cn700_mem_type(struct openchrome_drm_private *dev_private,
+static int cn700_mem_type(struct via_drm_priv *dev_private,
struct pci_dev *fn3)
{
int ret;
@@ -633,7 +633,7 @@ static int cn700_mem_type(struct openchrome_drm_private *dev_private,
return ret;
}
-static int cx700_mem_type(struct openchrome_drm_private *dev_private,
+static int cx700_mem_type(struct via_drm_priv *dev_private,
struct pci_dev *fn3)
{
u8 type, clock;
@@ -692,7 +692,7 @@ static int cx700_mem_type(struct openchrome_drm_private *dev_private,
return ret;
}
-static int vx900_mem_type(struct openchrome_drm_private *dev_private,
+static int vx900_mem_type(struct via_drm_priv *dev_private,
struct pci_dev *fn3)
{
int ret;
@@ -767,7 +767,7 @@ static int vx900_mem_type(struct openchrome_drm_private *dev_private,
return ret;
}
-int openchrome_vram_detect(struct openchrome_drm_private *dev_private)
+int openchrome_vram_detect(struct via_drm_priv *dev_private)
{
struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -1004,7 +1004,7 @@ out_err:
return ret;
}
-static void openchrome_flag_init(struct openchrome_drm_private *dev_private)
+static void openchrome_flag_init(struct via_drm_priv *dev_private)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1014,8 +1014,7 @@ static void openchrome_flag_init(struct openchrome_drm_private *dev_private)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void openchrome_quirks_init(
- struct openchrome_drm_private *dev_private)
+static void openchrome_quirks_init(struct via_drm_priv *dev_private)
{
struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -1069,7 +1068,7 @@ static void openchrome_quirks_init(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_vram_init(struct openchrome_drm_private *dev_private)
+int openchrome_vram_init(struct via_drm_priv *dev_private)
{
int ret = 0;
@@ -1084,7 +1083,7 @@ int openchrome_vram_init(struct openchrome_drm_private *dev_private)
return ret;
}
-void openchrome_vram_fini(struct openchrome_drm_private *dev_private)
+void openchrome_vram_fini(struct via_drm_priv *dev_private)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1098,8 +1097,7 @@ void openchrome_vram_fini(struct openchrome_drm_private *dev_private)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_mmio_init(
- struct openchrome_drm_private *dev_private)
+int openchrome_mmio_init(struct via_drm_priv *dev_private)
{
struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -1127,7 +1125,7 @@ exit:
return ret;
}
-void openchrome_mmio_fini(struct openchrome_drm_private *dev_private)
+void openchrome_mmio_fini(struct via_drm_priv *dev_private)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1139,8 +1137,7 @@ void openchrome_mmio_fini(struct openchrome_drm_private *dev_private)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void openchrome_graphics_unlock(
- struct openchrome_drm_private *dev_private)
+void openchrome_graphics_unlock(struct via_drm_priv *dev_private)
{
uint8_t temp;
@@ -1168,7 +1165,7 @@ void openchrome_graphics_unlock(
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-void chip_revision_info(struct openchrome_drm_private *dev_private)
+void chip_revision_info(struct via_drm_priv *dev_private)
{
struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -1219,7 +1216,7 @@ void chip_revision_info(struct openchrome_drm_private *dev_private)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_device_init(struct openchrome_drm_private *dev_private)
+int openchrome_device_init(struct via_drm_priv *dev_private)
{
int ret;
@@ -1255,7 +1252,7 @@ exit:
return ret;
}
-void openchrome_device_fini(struct openchrome_drm_private *dev_private)
+void openchrome_device_fini(struct via_drm_priv *dev_private)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1272,8 +1269,7 @@ drm_mode_config_funcs openchrome_drm_mode_config_funcs = {
.atomic_commit = drm_atomic_helper_commit,
};
-void openchrome_mode_config_init(
- struct openchrome_drm_private *dev_private)
+void openchrome_mode_config_init(struct via_drm_priv *dev_private)
{
struct drm_device *dev = &dev_private->dev;
@@ -1301,8 +1297,7 @@ void openchrome_mode_config_init(
int openchrome_drm_init(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1342,8 +1337,7 @@ exit:
void openchrome_drm_fini(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioctl.c b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
index 281111588db7..e207647f9662 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioctl.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
@@ -43,8 +43,7 @@ static int openchrome_gem_create_ioctl(struct drm_device *dev,
struct drm_file *file_priv)
{
struct drm_openchrome_gem_create *args = data;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct openchrome_bo *bo;
uint32_t handle;
int ret;
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c b/drivers/gpu/drm/openchrome/openchrome_object.c
index ff1f7db605e8..97a8bbbb9fe8 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -173,8 +173,7 @@ int openchrome_bo_create(struct drm_device *dev,
bool kmap,
struct openchrome_bo **bo_ptr)
{
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct openchrome_bo *bo;
int ret;
@@ -276,7 +275,7 @@ exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-int openchrome_mm_init(struct openchrome_drm_private *dev_private)
+int openchrome_mm_init(struct via_drm_priv *dev_private)
{
struct drm_device *dev = &dev_private->dev;
int ret;
@@ -314,7 +313,7 @@ exit:
return ret;
}
-void openchrome_mm_fini(struct openchrome_drm_private *dev_private)
+void openchrome_mm_fini(struct via_drm_priv *dev_private)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/openchrome/openchrome_pm.c b/drivers/gpu/drm/openchrome/openchrome_pm.c
index 1696be5af6a9..26b9a58c2d76 100644
--- a/drivers/gpu/drm/openchrome/openchrome_pm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_pm.c
@@ -39,8 +39,7 @@ int openchrome_dev_pm_ops_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(drm_dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(drm_dev);
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -102,8 +101,7 @@ int openchrome_dev_pm_ops_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(drm_dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(drm_dev);
void __iomem *regs = ioport_map(0x3c0, 100);
u8 val;
int ret = 0;
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/openchrome_sii164.c
index 9c6b31dc1a78..460d4ed43494 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -135,8 +135,7 @@ static void openchrome_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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -199,8 +198,7 @@ static void openchrome_sii164_mode_set(struct drm_encoder *encoder,
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -243,8 +241,7 @@ static void openchrome_sii164_prepare(struct drm_encoder *encoder)
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -276,8 +273,7 @@ static void openchrome_sii164_commit(struct drm_encoder *encoder)
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -310,8 +306,7 @@ static void openchrome_sii164_disable(struct drm_encoder *encoder)
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -531,8 +526,7 @@ void openchrome_sii164_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/openchrome_tmds.c
index 721a9f4d03fb..1242188802b1 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -34,7 +34,7 @@
#include "openchrome_drv.h"
-static void via_tmds_power(struct openchrome_drm_private *dev_private,
+static void via_tmds_power(struct via_drm_priv *dev_private,
bool power_state)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -55,9 +55,8 @@ static void via_tmds_power(struct openchrome_drm_private *dev_private,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void via_tmds_io_pad_setting(
- struct openchrome_drm_private *dev_private,
- u32 di_port, bool io_pad_on)
+static void via_tmds_io_pad_setting(struct via_drm_priv *dev_private,
+ u32 di_port, bool io_pad_on)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -80,8 +79,7 @@ static void via_tmds_io_pad_setting(
* integrated TMDS transmitter. Synchronization polarity and
* display output source need to be set separately.
*/
-static void via_tmds_init_reg(
- struct openchrome_drm_private *dev_private)
+static void via_tmds_init_reg(struct via_drm_priv *dev_private)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -150,9 +148,8 @@ static void via_tmds_init_reg(
/*
* Set TMDS (DVI) sync polarity.
*/
-static void via_tmds_sync_polarity(
- struct openchrome_drm_private *dev_private,
- unsigned int flags)
+static void via_tmds_sync_polarity(struct via_drm_priv *dev_private,
+ unsigned int flags)
{
u8 syncPolarity = 0x00;
@@ -178,9 +175,8 @@ static void via_tmds_sync_polarity(
/*
* Sets TMDS (DVI) display source.
*/
-static void via_tmds_display_source(
- struct openchrome_drm_private *dev_private,
- int index)
+static void via_tmds_display_source(struct via_drm_priv *dev_private,
+ int index)
{
u8 displaySource = index;
@@ -205,8 +201,7 @@ 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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -249,8 +244,7 @@ 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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -265,8 +259,7 @@ 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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -285,8 +278,7 @@ via_tmds_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct via_crtc *iga = container_of(encoder->crtc,
struct via_crtc, base);
@@ -304,8 +296,7 @@ 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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -415,8 +406,7 @@ static const struct drm_connector_helper_funcs via_dvi_connector_helper_funcs =
void via_tmds_probe(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
u16 chipset = pdev->device;
u8 sr13, sr5a;
@@ -495,8 +485,7 @@ void via_tmds_probe(struct drm_device *dev)
void via_tmds_init(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct via_connector *con;
struct via_encoder *enc;
@@ -549,8 +538,7 @@ exit:
void openchrome_ext_dvi_probe(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
u16 chipset = pdev->device;
u8 sr12, sr13;
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index ac1faa86ead6..cc322f4e2618 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -145,8 +145,8 @@ static void openchrome_bo_delete_mem_notify(struct ttm_buffer_object *bo)
static int openchrome_bo_io_mem_reserve(struct ttm_device *bdev,
struct ttm_resource *mem)
{
- struct openchrome_drm_private *dev_private = container_of(bdev,
- struct openchrome_drm_private, bdev);
+ struct via_drm_priv *dev_private = container_of(bdev,
+ struct via_drm_priv, bdev);
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index 864dc26fae18..6cfe98367772 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -155,8 +155,7 @@ static void openchrome_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 openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -219,8 +218,7 @@ static void openchrome_vt1632_mode_set(struct drm_encoder *encoder,
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -263,8 +261,7 @@ static void openchrome_vt1632_prepare(struct drm_encoder *encoder)
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -296,8 +293,7 @@ static void openchrome_vt1632_commit(struct drm_encoder *encoder)
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -330,8 +326,7 @@ static void openchrome_vt1632_disable(struct drm_encoder *encoder)
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
struct drm_device *dev = encoder->dev;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -551,8 +546,7 @@ void openchrome_vt1632_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
- struct openchrome_drm_private *dev_private =
- to_openchrome_private(dev);
+ struct via_drm_priv *dev_private = to_via_drm_priv(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
More information about the openchrome-devel
mailing list