[openchrome-devel] drm-openchrome: Branch 'drm-next-5.18' - 5 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Fri May 20 16:59:06 UTC 2022
drivers/gpu/drm/openchrome/openchrome_analog.c | 53 +++++++++++++-----------
drivers/gpu/drm/openchrome/openchrome_clocks.c | 4 -
drivers/gpu/drm/openchrome/openchrome_crtc.c | 38 +++++++++--------
drivers/gpu/drm/openchrome/openchrome_cursor.c | 8 +--
drivers/gpu/drm/openchrome/openchrome_display.c | 6 +-
drivers/gpu/drm/openchrome/openchrome_drv.c | 25 +++++++----
drivers/gpu/drm/openchrome/openchrome_drv.h | 9 ++--
drivers/gpu/drm/openchrome/openchrome_fp.c | 45 ++++++++++----------
drivers/gpu/drm/openchrome/openchrome_hdmi.c | 16 ++++---
drivers/gpu/drm/openchrome/openchrome_i2c.c | 12 +++--
drivers/gpu/drm/openchrome/openchrome_init.c | 34 ++++-----------
drivers/gpu/drm/openchrome/openchrome_ioctl.c | 3 -
drivers/gpu/drm/openchrome/openchrome_object.c | 5 +-
drivers/gpu/drm/openchrome/openchrome_pm.c | 5 +-
drivers/gpu/drm/openchrome/openchrome_sii164.c | 18 +++++---
drivers/gpu/drm/openchrome/openchrome_tmds.c | 34 +++++++++------
drivers/gpu/drm/openchrome/openchrome_vt1632.c | 18 +++++---
17 files changed, 191 insertions(+), 142 deletions(-)
New commits:
commit 529d1fc221aff08944cd817e4aec04d728a51ddd
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri May 20 11:56:43 2022 -0500
drm/openchrome: Version bumped to 3.4.19
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 e3b21826d4e4..e1081359d660 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -54,10 +54,10 @@
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 4
-#define DRIVER_PATCHLEVEL 18
+#define DRIVER_PATCHLEVEL 19
#define DRIVER_NAME "openchrome"
#define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20220209"
+#define DRIVER_DATE "20220519"
#define DRIVER_AUTHOR "OpenChrome Project"
commit 1fdd81f16d24347ca19379fe1422e775fad98905
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri May 20 11:56:41 2022 -0500
drm/openchrome: Use devm_drm_dev_alloc
Based on commit cd82945 (drm/aspeed: Use devm_drm_dev_alloc).
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 83438c38d5a4..d21e9966a6ee 100644
--- a/drivers/gpu/drm/openchrome/openchrome_analog.c
+++ b/drivers/gpu/drm/openchrome/openchrome_analog.c
@@ -108,8 +108,9 @@ static const struct drm_encoder_funcs via_dac_enc_funcs = {
static void
via_analog_dpms(struct drm_encoder *encoder, int mode)
{
+ struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -159,8 +160,9 @@ 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 openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -174,8 +176,9 @@ via_analog_mode_set(struct drm_encoder *encoder,
static void
via_analog_prepare(struct drm_encoder *encoder)
{
+ struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -190,8 +193,9 @@ via_analog_prepare(struct drm_encoder *encoder)
static void
via_analog_commit(struct drm_encoder *encoder)
{
+ struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -206,8 +210,9 @@ via_analog_commit(struct drm_encoder *encoder)
static void
via_analog_disable(struct drm_encoder *encoder)
{
+ struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -353,7 +358,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 =
- dev->dev_private;
+ to_openchrome_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev);
u16 chipset = pdev->device;
u8 sr13, sr5a;
@@ -408,7 +413,8 @@ void via_analog_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
- struct openchrome_drm_private *dev_private = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(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 ac7cfb6802ae..15cfcdb8cd16 100644
--- a/drivers/gpu/drm/openchrome/openchrome_clocks.c
+++ b/drivers/gpu/drm/openchrome/openchrome_clocks.c
@@ -197,10 +197,10 @@ void
via_set_vclock(struct drm_crtc *crtc, u32 clk)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
- struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
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);
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 876cdb422442..8c2c5b81a8a2 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -188,7 +188,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 =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
int end = (size > 256) ? 256 : size, i;
@@ -1112,9 +1112,10 @@ void
via_load_crtc_pixel_timing(struct drm_crtc *crtc,
struct drm_display_mode *mode)
{
+ struct drm_device *dev = crtc->dev;
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
u32 reg_value = 0;
reg_value = IGA1_PIXELTIMING_HOR_TOTAL_FORMULA(mode->crtc_htotal);
@@ -1188,10 +1189,10 @@ via_load_crtc_pixel_timing(struct drm_crtc *crtc,
void
via_load_crtc_timing(struct via_crtc *iga, struct drm_display_mode *mode)
{
- struct openchrome_drm_private *dev_private =
- iga->base.dev->dev_private;
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);
u32 reg_value = 0;
if (!iga->index) {
@@ -1287,11 +1288,11 @@ void
via_set_scale_path(struct drm_crtc *crtc, u32 scale_type)
{
struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
- struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
- u8 reg_cr_fd = vga_rcrt(VGABASE, 0xFD);
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);
+ u8 reg_cr_fd = vga_rcrt(VGABASE, 0xFD);
if (!iga->index)
/* register reuse: select IGA1 path */
@@ -1334,8 +1335,9 @@ 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;
struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
if (iga->index) {
/* IGA2 scalings disable */
@@ -1381,8 +1383,9 @@ 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;
struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
if (!(scale_type & (VIA_SHRINK + VIA_EXPAND)))
return false;
@@ -1601,7 +1604,7 @@ void openchrome_mode_set_nofb(struct drm_crtc *crtc)
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
u8 reg_value = 0;
int ret;
@@ -1809,8 +1812,9 @@ exit:
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 =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -1828,8 +1832,9 @@ static void openchrome_crtc_helper_atomic_enable(struct drm_crtc *crtc,
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 =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -1860,7 +1865,7 @@ static int openchrome_primary_atomic_check(struct drm_plane *plane,
struct drm_device *dev = plane->dev;
struct drm_framebuffer *fb = new_plane_state->fb;
struct openchrome_drm_private *dev_private =
- plane->dev->dev_private;
+ to_openchrome_private(dev);
uint32_t frame_buffer_size;
int ret = 0;
@@ -1916,8 +1921,9 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
(new_state->crtc_x * fb->format->cpp[0]);
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 =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
struct openchrome_bo *bo;
@@ -2062,7 +2068,7 @@ static void openchrome_crtc_param_init(
struct drm_crtc *crtc,
uint32_t index)
{
- struct drm_device *dev = dev_private->dev;
+ struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -2255,7 +2261,7 @@ static const uint32_t openchrome_primary_formats[] = {
int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
uint32_t index)
{
- struct drm_device *dev = dev_private->dev;
+ struct drm_device *dev = &dev_private->dev;
struct via_crtc *iga;
struct drm_plane *primary;
struct drm_plane *cursor;
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index e822b287c1e0..37d4650f0bf4 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -58,7 +58,7 @@ static void openchrome_hide_cursor(struct drm_crtc *crtc)
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
struct openchrome_drm_private *dev_private =
- dev->dev_private;
+ to_openchrome_private(dev);
uint32_t temp;
switch (pdev->device) {
@@ -91,7 +91,7 @@ static void openchrome_show_cursor(struct drm_crtc *crtc)
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_VT3157:
@@ -169,7 +169,7 @@ static void openchrome_cursor_address(struct drm_crtc *crtc,
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
+ to_openchrome_private(dev);
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_VT3157:
@@ -210,7 +210,7 @@ static void openchrome_set_hi_location(struct drm_crtc *crtc,
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
+ to_openchrome_private(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 04e472ea5e00..311e191fe2c3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -91,7 +91,8 @@ 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 = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
unsigned int td_timer[4] = { 500, 50, 0, 510 }, i;
struct vga_registers timings;
u32 reg_value;
@@ -127,7 +128,8 @@ int
via_modeset_init(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(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 d64ff06d5829..d20da99bc515 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -90,7 +90,8 @@ static int openchrome_driver_dumb_create(
struct drm_device *dev,
struct drm_mode_create_dumb *args)
{
- struct openchrome_drm_private *dev_private = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
struct openchrome_bo *bo;
uint32_t handle, pitch;
uint64_t size;
@@ -199,6 +200,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;
int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -214,28 +216,31 @@ static int openchrome_pci_probe(struct pci_dev *pdev,
goto exit;
}
- dev = drm_dev_alloc(&openchrome_driver, &pdev->dev);
- if (IS_ERR(dev)) {
- ret = PTR_ERR(dev);
- goto error_disable_pci;
+ dev_private = devm_drm_dev_alloc(&pdev->dev,
+ &openchrome_driver,
+ struct openchrome_drm_private,
+ dev);
+ if (IS_ERR(dev_private)) {
+ ret = PTR_ERR(dev_private);
+ goto exit;
}
+ dev = &dev_private->dev;
+
pci_set_drvdata(pdev, dev);
ret = openchrome_drm_init(dev);
if (ret) {
- goto err_drm_dev_put;
+ goto error_disable_pci;
}
ret = drm_dev_register(dev, ent->driver_data);
if (ret) {
- goto err_drm_dev_put;
+ goto error_disable_pci;
}
drm_fbdev_generic_setup(dev, 32);
goto exit;
-err_drm_dev_put:
- drm_dev_put(dev);
error_disable_pci:
pci_disable_device(pdev);
exit:
@@ -251,7 +256,6 @@ static void openchrome_pci_remove(struct pci_dev *pdev)
openchrome_drm_fini(dev);
drm_dev_unregister(dev);
- drm_dev_put(dev);
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 02fa1e541fce..e3b21826d4e4 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -204,7 +204,7 @@ enum via_engine {
};
struct openchrome_drm_private {
- struct drm_device *dev;
+ struct drm_device dev;
struct ttm_device bdev;
@@ -312,6 +312,9 @@ struct openchrome_drm_private {
};
+#define to_openchrome_private(x) container_of(x, struct openchrome_drm_private, dev)
+
+
/* VIA MMIO register access */
#define VIA_BASE ((dev_private->mmio))
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index 793bb76933a6..57d0afdc464e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -594,7 +594,7 @@ static void via_fp_dpms(struct drm_encoder *encoder, int mode)
struct drm_device *dev = encoder->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -691,7 +691,7 @@ static void via_fp_prepare(struct drm_encoder *encoder)
struct drm_device *dev = encoder->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -711,7 +711,7 @@ static void via_fp_commit(struct drm_encoder *encoder)
struct drm_device *dev = encoder->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -733,7 +733,7 @@ via_fp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
struct drm_device *dev = encoder->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -779,7 +779,7 @@ static void via_fp_disable(struct drm_encoder *encoder)
struct drm_device *dev = encoder->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
/* PCI Device ID */
u16 chipset = pdev->device;
@@ -813,7 +813,7 @@ via_fp_detect(struct drm_connector *connector, bool force)
struct via_connector *con = container_of(connector,
struct via_connector, base);
struct openchrome_drm_private *dev_private =
- connector->dev->dev_private;
+ to_openchrome_private(dev);
enum drm_connector_status ret = connector_status_disconnected;
struct i2c_adapter *i2c_bus;
struct edid *edid = NULL;
@@ -939,7 +939,8 @@ 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 = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
struct edid *edid = NULL;
struct drm_display_mode *native_mode = NULL;
@@ -1092,7 +1093,8 @@ 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 = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
struct drm_connector connector;
struct i2c_adapter *i2c_bus;
struct edid *edid;
@@ -1338,7 +1340,8 @@ void via_fp_probe(struct drm_device *dev)
void via_fp_init(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(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 416b8b9a060f..4156af134b81 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -51,8 +51,9 @@ static const struct drm_encoder_funcs via_hdmi_enc_funcs = {
static void
via_hdmi_enc_dpms(struct drm_encoder *encoder, int mode)
{
+ struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
switch (mode) {
case DRM_MODE_DPMS_SUSPEND:
@@ -161,7 +162,9 @@ static void
via_hdmi_native_mode_set(struct via_crtc *iga, struct drm_display_mode *mode,
bool audio_off)
{
- struct openchrome_drm_private *dev_private = iga->base.dev->dev_private;
+ struct drm_device *dev = iga->base.dev;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
u32 reg_c280, reg_c284;
int max_packet, delay;
u8 value = BIT(0);
@@ -248,10 +251,11 @@ via_hdmi_enc_mode_set(struct drm_encoder *encoder,
{
struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
- struct openchrome_drm_private *dev_private = encoder->dev->dev_private;
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);
list_for_each_entry(con, &dev->mode_config.connector_list, head) {
if (encoder == con->encoder) {
@@ -499,8 +503,9 @@ 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;
struct openchrome_drm_private *dev_private =
- connector->dev->dev_private;
+ to_openchrome_private(dev);
struct edid *edid = NULL;
int i, j = 0;
u8 *block;
@@ -591,8 +596,9 @@ out:
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 =
- connector->dev->dev_private;
+ to_openchrome_private(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 e82bebaf5344..1c6385f55a01 100644
--- a/drivers/gpu/drm/openchrome/openchrome_i2c.c
+++ b/drivers/gpu/drm/openchrome/openchrome_i2c.c
@@ -33,7 +33,8 @@ 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 = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
u8 value, mask;
if (i2c->is_active == GPIO) {
@@ -51,7 +52,8 @@ 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 = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
u8 value, mask;
if (i2c->is_active == GPIO) {
@@ -69,7 +71,8 @@ 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 = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
return vga_rseq(VGABASE, i2c->i2c_port) & BIT(2);
}
@@ -78,7 +81,8 @@ 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 = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
return vga_rseq(VGABASE, i2c->i2c_port) & BIT(3);
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 17d376586b70..d252b3295c7e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -769,7 +769,7 @@ static int vx900_mem_type(struct openchrome_drm_private *dev_private,
int openchrome_vram_detect(struct openchrome_drm_private *dev_private)
{
- struct drm_device *dev = dev_private->dev;
+ struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct pci_dev *bridge = NULL;
struct pci_dev *fn3 = NULL;
@@ -1017,7 +1017,7 @@ static void openchrome_flag_init(struct openchrome_drm_private *dev_private)
static void openchrome_quirks_init(
struct openchrome_drm_private *dev_private)
{
- struct drm_device *dev = dev_private->dev;
+ struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1101,7 +1101,7 @@ void openchrome_vram_fini(struct openchrome_drm_private *dev_private)
int openchrome_mmio_init(
struct openchrome_drm_private *dev_private)
{
- struct drm_device *dev = dev_private->dev;
+ struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
int ret = 0;
@@ -1170,7 +1170,7 @@ void openchrome_graphics_unlock(
void chip_revision_info(struct openchrome_drm_private *dev_private)
{
- struct drm_device *dev = dev_private->dev;
+ struct drm_device *dev = &dev_private->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
u8 tmp;
@@ -1275,7 +1275,7 @@ drm_mode_config_funcs openchrome_drm_mode_config_funcs = {
void openchrome_mode_config_init(
struct openchrome_drm_private *dev_private)
{
- struct drm_device *dev = dev_private->dev;
+ struct drm_device *dev = &dev_private->dev;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1301,34 +1301,24 @@ void openchrome_mode_config_init(
int openchrome_drm_init(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- dev_private = kzalloc(sizeof(struct openchrome_drm_private),
- GFP_KERNEL);
- if (!dev_private) {
- ret = -ENOMEM;
- DRM_ERROR("Failed to allocate private "
- "storage memory.\n");
- goto exit;
- }
-
- dev->dev_private = (void *) dev_private;
- dev_private->dev = dev;
dev_private->vram_mtrr = -ENXIO;
ret = openchrome_device_init(dev_private);
if (ret) {
DRM_ERROR("Failed to initialize Chrome IGP.\n");
- goto error_free_private;
+ goto exit;
}
ret = openchrome_mm_init(dev_private);
if (ret) {
DRM_ERROR("Failed to initialize TTM.\n");
- goto error_free_private;
+ goto exit;
}
chip_revision_info(dev_private);
@@ -1345,8 +1335,6 @@ error_modeset:
openchrome_mm_fini(dev_private);
openchrome_mmio_fini(dev_private);
openchrome_vram_fini(dev_private);
-error_free_private:
- kfree(dev_private);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
@@ -1354,7 +1342,8 @@ exit:
void openchrome_drm_fini(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1362,7 +1351,6 @@ void openchrome_drm_fini(struct drm_device *dev)
openchrome_mm_fini(dev_private);
openchrome_mmio_fini(dev_private);
openchrome_vram_fini(dev_private);
- kfree(dev_private);
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 1b8581151972..281111588db7 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioctl.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
@@ -43,7 +43,8 @@ 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 = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(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 d8446b5633b3..ff1f7db605e8 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -173,7 +173,8 @@ int openchrome_bo_create(struct drm_device *dev,
bool kmap,
struct openchrome_bo **bo_ptr)
{
- struct openchrome_drm_private *dev_private = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
struct openchrome_bo *bo;
int ret;
@@ -277,7 +278,7 @@ exit:
int openchrome_mm_init(struct openchrome_drm_private *dev_private)
{
- struct drm_device *dev = dev_private->dev;
+ struct drm_device *dev = &dev_private->dev;
int ret;
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 f0d837d7c1d1..1696be5af6a9 100644
--- a/drivers/gpu/drm/openchrome/openchrome_pm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_pm.c
@@ -39,7 +39,8 @@ 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 = drm_dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(drm_dev);
int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -102,7 +103,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 =
- drm_dev->dev_private;
+ to_openchrome_private(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 ec3fb06095bb..9c6b31dc1a78 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -134,8 +134,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -197,8 +198,9 @@ static void openchrome_sii164_mode_set(struct drm_encoder *encoder,
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
+ struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -240,8 +242,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -272,8 +275,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -305,8 +309,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -526,7 +531,8 @@ void openchrome_sii164_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
- struct openchrome_drm_private *dev_private = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(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 9db6bf1c4923..721a9f4d03fb 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -204,8 +204,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -247,8 +248,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -262,8 +264,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -281,8 +284,9 @@ 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 openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct via_crtc *iga = container_of(encoder->crtc,
struct via_crtc, base);
@@ -299,8 +303,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -409,8 +414,9 @@ static const struct drm_connector_helper_funcs via_dvi_connector_helper_funcs =
*/
void via_tmds_probe(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private = dev->dev_private;
struct pci_dev *pdev = to_pci_dev(dev->dev);
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
u16 chipset = pdev->device;
u8 sr13, sr5a;
@@ -489,7 +495,8 @@ void via_tmds_probe(struct drm_device *dev)
void via_tmds_init(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
struct via_connector *con;
struct via_encoder *enc;
@@ -541,9 +548,10 @@ exit:
*/
void openchrome_ext_dvi_probe(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private = dev->dev_private;
- struct i2c_adapter *i2c_bus;
struct pci_dev *pdev = to_pci_dev(dev->dev);
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
+ struct i2c_adapter *i2c_bus;
u16 chipset = pdev->device;
u8 sr12, sr13;
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index c2ace7e257dd..864dc26fae18 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -154,8 +154,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -217,8 +218,9 @@ static void openchrome_vt1632_mode_set(struct drm_encoder *encoder,
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
struct via_encoder *enc = container_of(encoder,
struct via_encoder, base);
+ struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -260,8 +262,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -292,8 +295,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -325,8 +329,9 @@ 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 =
- encoder->dev->dev_private;
+ to_openchrome_private(dev);
struct i2c_adapter *i2c_bus;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -546,7 +551,8 @@ void openchrome_vt1632_init(struct drm_device *dev)
{
struct via_connector *con;
struct via_encoder *enc;
- struct openchrome_drm_private *dev_private = dev->dev_private;
+ struct openchrome_drm_private *dev_private =
+ to_openchrome_private(dev);
DRM_DEBUG_KMS("Entered %s.\n", __func__);
commit 17cd48c21e1085f2542ee701d66025b812f50592
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri May 20 11:56:39 2022 -0500
drm/openchrome: Check for error after calling openchrome_drm_init()
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 d5c131bb05c8..d64ff06d5829 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -223,6 +223,9 @@ static int openchrome_pci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, dev);
ret = openchrome_drm_init(dev);
+ if (ret) {
+ goto err_drm_dev_put;
+ }
ret = drm_dev_register(dev, ent->driver_data);
if (ret) {
commit da7bdcf4829a78bf837b19103f9d947328286d2b
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri May 20 11:56:38 2022 -0500
drm/openchrome: Convert logged hardcoded function names to programmable ones
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 e00d2119eb04..83438c38d5a4 100644
--- a/drivers/gpu/drm/openchrome/openchrome_analog.c
+++ b/drivers/gpu/drm/openchrome/openchrome_analog.c
@@ -39,13 +39,14 @@
static void via_analog_power(struct openchrome_drm_private *dev_private,
bool outputState)
{
- DRM_DEBUG_KMS("Entered via_analog_power.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
via_analog_set_power(VGABASE, outputState);
DRM_INFO("Analog (VGA) Power: %s\n",
outputState ? "On" : "Off");
- DRM_DEBUG_KMS("Exiting via_analog_power.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
/*
@@ -57,7 +58,7 @@ static void via_analog_sync_polarity(
{
u8 syncPolarity = 0x00;
- DRM_DEBUG_KMS("Entered via_analog_sync_polarity.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (flags & DRM_MODE_FLAG_NHSYNC) {
syncPolarity |= BIT(0);
@@ -73,7 +74,7 @@ static void via_analog_sync_polarity(
DRM_INFO("Analog (VGA) Vertical Sync Polarity: %s\n",
(syncPolarity & BIT(1)) ? "-" : "+");
- DRM_DEBUG_KMS("Exiting via_analog_sync_polarity.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
/*
@@ -85,13 +86,13 @@ static void via_analog_display_source(
{
u8 displaySource = index;
- DRM_DEBUG_KMS("Entered via_analog_display_source.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
via_analog_set_display_source(VGABASE, displaySource & 0x01);
DRM_INFO("Analog (VGA) Display Source: IGA%d\n",
(displaySource & 0x01) + 1);
- DRM_DEBUG_KMS("Exiting via_analog_display_source.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
/*
@@ -110,7 +111,7 @@ via_analog_dpms(struct drm_encoder *encoder, int mode)
struct openchrome_drm_private *dev_private =
encoder->dev->dev_private;
- DRM_DEBUG_KMS("Entered via_analog_dpms.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
switch (mode) {
case DRM_MODE_DPMS_ON:
@@ -134,7 +135,7 @@ via_analog_dpms(struct drm_encoder *encoder, int mode)
break;
}
- DRM_DEBUG_KMS("Exiting via_analog_dpms.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
/* Pass our mode to the connectors and the CRTC to give them a chance to
@@ -162,12 +163,12 @@ via_analog_mode_set(struct drm_encoder *encoder,
encoder->dev->dev_private;
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, base);
- DRM_DEBUG_KMS("Entered via_analog_mode_set.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
via_analog_sync_polarity(dev_private, adjusted_mode->flags);
via_analog_display_source(dev_private, iga->index);
- DRM_DEBUG_KMS("Exiting via_analog_mode_set.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void
@@ -176,14 +177,14 @@ via_analog_prepare(struct drm_encoder *encoder)
struct openchrome_drm_private *dev_private =
encoder->dev->dev_private;
- DRM_DEBUG_KMS("Entered via_analog_prepare.\n");
+ 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);
}
- DRM_DEBUG_KMS("Exiting via_analog_prepare.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void
@@ -192,14 +193,14 @@ via_analog_commit(struct drm_encoder *encoder)
struct openchrome_drm_private *dev_private =
encoder->dev->dev_private;
- DRM_DEBUG_KMS("Entered via_analog_commit.\n");
+ 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);
}
- DRM_DEBUG_KMS("Exiting via_analog_commit.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void
@@ -208,12 +209,12 @@ via_analog_disable(struct drm_encoder *encoder)
struct openchrome_drm_private *dev_private =
encoder->dev->dev_private;
- DRM_DEBUG_KMS("Entered via_analog_disable.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
via_analog_set_dpms_control(VGABASE, VIA_ANALOG_DPMS_OFF);
via_analog_power(dev_private, false);
- DRM_DEBUG_KMS("Exiting via_analog_disable.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static const struct drm_encoder_helper_funcs via_dac_enc_helper_funcs = {
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index d5706fb52448..793bb76933a6 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -140,7 +140,7 @@ static void via_fp_castle_rock_soft_power_seq(
struct openchrome_drm_private *dev_private,
bool power_state)
{
- DRM_DEBUG_KMS("Entered via_fp_castle_rock_soft_power_seq.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (power_state) {
/* Wait for 25 ms. */
@@ -186,14 +186,14 @@ static void via_fp_castle_rock_soft_power_seq(
via_fp_set_primary_soft_vdd(VGABASE, false);
}
- DRM_DEBUG_KMS("Exiting via_fp_castle_rock_soft_power_seq.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void via_fp_primary_soft_power_seq(
struct openchrome_drm_private *dev_private,
bool power_state)
{
- DRM_DEBUG_KMS("Entered via_fp_primary_soft_power_seq.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
/* Turn off FP hardware power sequence. */
via_fp_set_primary_hard_power(VGABASE, false);
@@ -254,14 +254,14 @@ static void via_fp_primary_soft_power_seq(
via_fp_set_primary_direct_display_period(VGABASE, false);
}
- DRM_DEBUG_KMS("Exiting via_fp_primary_soft_power_seq.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void via_fp_secondary_soft_power_seq(
struct openchrome_drm_private *dev_private,
bool power_state)
{
- DRM_DEBUG_KMS("Entered via_fp_secondary_soft_power_seq.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
/* Turn off FP hardware power sequence. */
via_fp_set_secondary_hard_power(VGABASE, false);
@@ -322,14 +322,14 @@ static void via_fp_secondary_soft_power_seq(
via_fp_set_secondary_direct_display_period(VGABASE, false);
}
- DRM_DEBUG_KMS("Exiting via_fp_secondary_soft_power_seq.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void via_fp_primary_hard_power_seq(
struct openchrome_drm_private *dev_private,
bool power_state)
{
- DRM_DEBUG_KMS("Entered via_fp_primary_hard_power_seq.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
/* Use hardware FP power sequence control. */
via_fp_set_primary_power_seq_type(VGABASE, true);
@@ -354,7 +354,7 @@ static void via_fp_primary_hard_power_seq(
via_fp_set_primary_direct_display_period(VGABASE, false);
}
- DRM_DEBUG_KMS("Exiting via_fp_primary_hard_power_seq.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void via_fp_power(
@@ -362,7 +362,7 @@ static void via_fp_power(
unsigned short device,
u32 di_port, bool power_state)
{
- DRM_DEBUG_KMS("Entered via_fp_power.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
switch (device) {
case PCI_DEVICE_ID_VIA_CLE266:
@@ -406,7 +406,7 @@ static void via_fp_power(
break;
}
- DRM_DEBUG_KMS("Exiting via_fp_power.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
/*
@@ -544,7 +544,7 @@ static void via_fp_display_source(
{
u8 display_source = index & 0x01;
- DRM_DEBUG_KMS("Entered via_fp_display_source.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
switch(di_port) {
case VIA_DI_PORT_DVP0:
@@ -584,7 +584,7 @@ static void via_fp_display_source(
DRM_DEBUG_KMS("FP Display Source: IGA%d\n",
display_source + 1);
- DRM_DEBUG_KMS("Exiting via_fp_display_source.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static void via_fp_dpms(struct drm_encoder *encoder, int mode)
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/openchrome_tmds.c
index 8253bc0e4b72..9db6bf1c4923 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -156,7 +156,7 @@ static void via_tmds_sync_polarity(
{
u8 syncPolarity = 0x00;
- DRM_DEBUG_KMS("Entered via_tmds_sync_polarity.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (flags & DRM_MODE_FLAG_NHSYNC) {
syncPolarity |= BIT(0);
@@ -172,7 +172,7 @@ static void via_tmds_sync_polarity(
DRM_INFO("TMDS (DVI) Vertical Sync Polarity: %s\n",
(syncPolarity & BIT(1)) ? "-" : "+");
- DRM_DEBUG_KMS("Exiting via_tmds_sync_polarity.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
/*
@@ -184,13 +184,13 @@ static void via_tmds_display_source(
{
u8 displaySource = index;
- DRM_DEBUG_KMS("Entered via_tmds_display_source.\n");
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
via_tmds_set_display_source(VGABASE, displaySource & 0x01);
DRM_INFO("TMDS (DVI) Display Source: IGA%d\n",
(displaySource & 0x01) + 1);
- DRM_DEBUG_KMS("Exiting via_tmds_display_source.\n");
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
/*
commit 13fd23facd11c34fa4f32bf6f684d50c7e80a346
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri May 20 11:56:36 2022 -0500
drm/openchrome: Correct an erroneous exit message
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 b05004ec60c7..d5706fb52448 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -354,7 +354,7 @@ static void via_fp_primary_hard_power_seq(
via_fp_set_primary_direct_display_period(VGABASE, false);
}
- DRM_DEBUG_KMS("Entered via_fp_primary_hard_power_seq.\n");
+ DRM_DEBUG_KMS("Exiting via_fp_primary_hard_power_seq.\n");
}
static void via_fp_power(
More information about the openchrome-devel
mailing list