[openchrome-devel] drm-openchrome: Branch 'drm-next-5.5' - 8 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Sun Oct 20 02:19:49 UTC 2019
drivers/gpu/drm/openchrome/openchrome_crtc.c | 295 +++++++++---------------
drivers/gpu/drm/openchrome/openchrome_display.c | 4
drivers/gpu/drm/openchrome/openchrome_drv.h | 10
3 files changed, 132 insertions(+), 177 deletions(-)
New commits:
commit 8fe47f76b3f2822a6a7a0898b2fdde5964388ba6
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sat Oct 19 19:16:38 2019 -0700
drm/openchrome: Version bumped to 3.1.19
Extensive refactoring of DRM plane and CRTC code.
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 a91744aa9a50..2c5d8a71dbc7 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -61,10 +61,10 @@
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 1
-#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 "20191016"
+#define DRIVER_DATE "20191019"
#define DRIVER_AUTHOR "OpenChrome Project"
commit 0e8ba736159565ff57fabbff4946861f5052ea30
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sat Oct 19 11:20:44 2019 -0700
drm/openchrome: Rename via_crtc_init()
The new name is openchrome_crtc_param_init().
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 dbed11a66ea3..5bb3eb1b6d95 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -2164,15 +2164,15 @@ exit:
return ret;
}
-int via_crtc_init(struct drm_device *dev, uint32_t index)
+void openchrome_crtc_param_init(
+ struct openchrome_drm_private *dev_private,
+ uint32_t index)
{
- struct openchrome_drm_private *dev_private =
- dev->dev_private;
+ struct drm_device *dev = dev_private->dev;
struct via_crtc *iga = &dev_private->iga[index];
struct drm_crtc *crtc = &iga->base;
u16 *gamma;
uint32_t i;
- int ret = 0;
if (iga->index) {
iga->timings.htotal.count = ARRAY_SIZE(iga2_hor_total);
@@ -2332,6 +2332,4 @@ int via_crtc_init(struct drm_device *dev, uint32_t index)
gamma[i + 256] = i << 8 | i;
gamma[i + 512] = i << 8 | i;
}
-
- return ret;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index e8482e9a207a..91ff28861703 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -499,10 +499,7 @@ via_modeset_init(struct drm_device *dev)
goto exit;
}
- ret = via_crtc_init(dev, i);
- if (ret) {
- goto exit;
- }
+ openchrome_crtc_param_init(dev_private, i);
}
openchrome_ext_dvi_probe(dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 922b6ca964f9..a91744aa9a50 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -468,7 +468,9 @@ extern 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,
uint32_t index);
-extern int via_crtc_init(struct drm_device *dev, uint32_t index);
+void openchrome_crtc_param_init(
+ struct openchrome_drm_private *dev_private,
+ uint32_t index);
/* encoders */
extern void via_set_sync_polarity(struct drm_encoder *encoder,
commit 76a37faf5de6efd4a37517a1658019b42b860c89
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sat Oct 19 11:05:44 2019 -0700
drm/openchrome: Move plane and CRTC initialization code into a new function
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 c31ad8acb693..dbed11a66ea3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -2073,17 +2073,16 @@ static const uint32_t openchrome_primary_formats[] = {
DRM_FORMAT_RGB332,
};
-int via_crtc_init(struct drm_device *dev, uint32_t index)
+int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
+ uint32_t index)
{
- struct openchrome_drm_private *dev_private =
- dev->dev_private;
+ struct drm_device *dev = dev_private->dev;
struct via_crtc *iga = &dev_private->iga[index];
struct drm_plane *primary;
struct drm_plane *cursor;
struct drm_crtc *crtc = &iga->base;
uint32_t possible_crtcs;
- int cursor_size = 64 * 64 * 4, i;
- u16 *gamma;
+ uint64_t cursor_size = 64 * 64 * 4;
int ret;
iga->index = index;
@@ -2152,6 +2151,29 @@ int via_crtc_init(struct drm_device *dev, uint32_t index)
goto cleanup_cursor;
}
+ goto exit;
+cleanup_cursor:
+ drm_plane_cleanup(cursor);
+free_cursor:
+ kfree(cursor);
+cleanup_primary:
+ drm_plane_cleanup(primary);
+free_primary:
+ kfree(primary);
+exit:
+ return ret;
+}
+
+int via_crtc_init(struct drm_device *dev, uint32_t index)
+{
+ struct openchrome_drm_private *dev_private =
+ dev->dev_private;
+ struct via_crtc *iga = &dev_private->iga[index];
+ struct drm_crtc *crtc = &iga->base;
+ u16 *gamma;
+ uint32_t i;
+ int ret = 0;
+
if (iga->index) {
iga->timings.htotal.count = ARRAY_SIZE(iga2_hor_total);
iga->timings.htotal.regs = iga2_hor_total;
@@ -2311,15 +2333,5 @@ int via_crtc_init(struct drm_device *dev, uint32_t index)
gamma[i + 512] = i << 8 | i;
}
- goto exit;
-cleanup_cursor:
- drm_plane_cleanup(cursor);
-free_cursor:
- kfree(cursor);
-cleanup_primary:
- drm_plane_cleanup(primary);
-free_primary:
- kfree(primary);
-exit:
return ret;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index f4be439cb72f..e8482e9a207a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -494,6 +494,11 @@ via_modeset_init(struct drm_device *dev)
via_hwcursor_init(dev_private);
for (i = 0; i < OPENCHROME_MAX_CRTC; i++) {
+ ret = openchrome_crtc_init(dev_private, i);
+ if (ret) {
+ goto exit;
+ }
+
ret = via_crtc_init(dev, i);
if (ret) {
goto exit;
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index d27469d32084..922b6ca964f9 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -466,6 +466,8 @@ extern void via_fbdev_fini(struct drm_device *dev);
/* crtc */
extern 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,
+ uint32_t index);
extern int via_crtc_init(struct drm_device *dev, uint32_t index);
/* encoders */
commit cb738635fe9759681af125856609850259d0e682
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sat Oct 19 10:37:43 2019 -0700
drm/openchrome: Invoke drm_crtc_helper_add() only once
Consolidate two separate drm_crtc_helper_funcs structs into one.
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 f8b5562ef1a4..c31ad8acb693 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -2055,18 +2055,7 @@ exit:
}
static const struct
-drm_crtc_helper_funcs openchrome_iga1_drm_crtc_helper_funcs = {
- .dpms = openchrome_crtc_dpms,
- .disable = openchrome_crtc_disable,
- .prepare = openchrome_crtc_prepare,
- .commit = openchrome_crtc_commit,
- .mode_fixup = openchrome_crtc_mode_fixup,
- .mode_set = openchrome_crtc_mode_set,
- .mode_set_base_atomic = openchrome_crtc_mode_set_base_atomic,
-};
-
-static const struct
-drm_crtc_helper_funcs openchrome_iga2_drm_crtc_helper_funcs = {
+drm_crtc_helper_funcs openchrome_drm_crtc_helper_funcs = {
.dpms = openchrome_crtc_dpms,
.disable = openchrome_crtc_disable,
.prepare = openchrome_crtc_prepare,
@@ -2137,14 +2126,8 @@ int via_crtc_init(struct drm_device *dev, uint32_t index)
goto free_cursor;
}
- if (iga->index) {
- drm_crtc_helper_add(crtc,
- &openchrome_iga2_drm_crtc_helper_funcs);
- } else {
- drm_crtc_helper_add(crtc,
- &openchrome_iga1_drm_crtc_helper_funcs);
- }
-
+ drm_crtc_helper_add(crtc,
+ &openchrome_drm_crtc_helper_funcs);
ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor,
&openchrome_drm_crtc_funcs,
NULL);
commit 3930b52d6a99b9fa6ddd6715e6ba5fcad8a713bd
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sat Oct 19 10:11:38 2019 -0700
drm/openchrome: Consolidate CRTC dpms code
It is being merged into openchrome_crtc_dpms().
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 0b0a80538a88..f8b5562ef1a4 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1582,6 +1582,63 @@ drm_mode_crtc_load_lut(struct drm_crtc *crtc)
}
}
+static void openchrome_crtc_dpms(struct drm_crtc *crtc, int mode)
+{
+ struct openchrome_drm_private *dev_private =
+ crtc->dev->dev_private;
+ struct via_crtc *iga = container_of(crtc,
+ struct via_crtc, base);
+
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ if (!iga->index) {
+ switch (mode) {
+ case DRM_MODE_DPMS_SUSPEND:
+ case DRM_MODE_DPMS_STANDBY:
+ case DRM_MODE_DPMS_OFF:
+ /* turn off CRT screen (IGA1) */
+ svga_wseq_mask(VGABASE, 0x01, BIT(5), BIT(5));
+
+ /* clear for TV clock */
+ svga_wcrt_mask(VGABASE, 0x6C, 0x00, 0xF0);
+ break;
+
+ case DRM_MODE_DPMS_ON:
+ /* turn on CRT screen (IGA1) */
+ svga_wseq_mask(VGABASE, 0x01, 0x00, BIT(5));
+
+ /* disable simultaneous */
+ svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
+ drm_mode_crtc_load_lut(crtc);
+ break;
+ }
+
+ } else {
+ switch (mode) {
+ case DRM_MODE_DPMS_SUSPEND:
+ case DRM_MODE_DPMS_STANDBY:
+ case DRM_MODE_DPMS_OFF:
+ /* turn off CRT screen (IGA2) */
+ svga_wcrt_mask(VGABASE, 0x6B, BIT(2), BIT(2));
+
+ /* clear for TV clock */
+ svga_wcrt_mask(VGABASE, 0x6C, 0x00, 0x0F);
+ break;
+
+ case DRM_MODE_DPMS_ON:
+ /* turn on CRT screen (IGA2) */
+ svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(2));
+
+ /* disable simultaneous */
+ svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
+ drm_mode_crtc_load_lut(crtc);
+ break;
+ }
+ }
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
static void openchrome_crtc_disable(struct drm_crtc *crtc)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -1997,73 +2054,9 @@ exit:
return ret;
}
-static void
-via_iga1_crtc_dpms(struct drm_crtc *crtc, int mode)
-{
- struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
-
- DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
- switch (mode) {
- case DRM_MODE_DPMS_SUSPEND:
- case DRM_MODE_DPMS_STANDBY:
- case DRM_MODE_DPMS_OFF:
- /* turn off CRT screen (IGA1) */
- svga_wseq_mask(VGABASE, 0x01, BIT(5), BIT(5));
-
- /* clear for TV clock */
- svga_wcrt_mask(VGABASE, 0x6C, 0x00, 0xF0);
- break;
-
- case DRM_MODE_DPMS_ON:
- /* turn on CRT screen (IGA1) */
- svga_wseq_mask(VGABASE, 0x01, 0x00, BIT(5));
-
- /* disable simultaneous */
- svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
- drm_mode_crtc_load_lut(crtc);
- break;
- }
-
- DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-static void
-via_iga2_crtc_dpms(struct drm_crtc *crtc, int mode)
-{
- struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
-
- DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
- switch (mode) {
- case DRM_MODE_DPMS_SUSPEND:
- case DRM_MODE_DPMS_STANDBY:
- case DRM_MODE_DPMS_OFF:
- /* turn off CRT screen (IGA2) */
- svga_wcrt_mask(VGABASE, 0x6B, BIT(2), BIT(2));
-
- /* clear for TV clock */
- svga_wcrt_mask(VGABASE, 0x6C, 0x00, 0x0F);
- break;
-
- case DRM_MODE_DPMS_ON:
- /* turn on CRT screen (IGA2) */
- svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(2));
-
- /* disable simultaneous */
- svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
- drm_mode_crtc_load_lut(crtc);
- break;
- }
-
- DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
static const struct
drm_crtc_helper_funcs openchrome_iga1_drm_crtc_helper_funcs = {
- .dpms = via_iga1_crtc_dpms,
+ .dpms = openchrome_crtc_dpms,
.disable = openchrome_crtc_disable,
.prepare = openchrome_crtc_prepare,
.commit = openchrome_crtc_commit,
@@ -2074,7 +2067,7 @@ drm_crtc_helper_funcs openchrome_iga1_drm_crtc_helper_funcs = {
static const struct
drm_crtc_helper_funcs openchrome_iga2_drm_crtc_helper_funcs = {
- .dpms = via_iga2_crtc_dpms,
+ .dpms = openchrome_crtc_dpms,
.disable = openchrome_crtc_disable,
.prepare = openchrome_crtc_prepare,
.commit = openchrome_crtc_commit,
commit 999f82852e6c643c9f81f595520b562c64a4a52b
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sat Oct 19 09:59:07 2019 -0700
drm/openchrome: Consolidate CRTC disable code
It is being merged into openchrome_crtc_disable().
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 cafd5db5ea5c..0b0a80538a88 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1582,6 +1582,15 @@ drm_mode_crtc_load_lut(struct drm_crtc *crtc)
}
}
+static void openchrome_crtc_disable(struct drm_crtc *crtc)
+{
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ crtc->helper_private->dpms(crtc, DRM_MODE_DPMS_OFF);
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
static void openchrome_crtc_prepare(struct drm_crtc *crtc)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -2021,16 +2030,6 @@ via_iga1_crtc_dpms(struct drm_crtc *crtc, int mode)
}
static void
-via_iga1_crtc_disable(struct drm_crtc *crtc)
-{
- DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
- via_iga1_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
-
- DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-static void
via_iga2_crtc_dpms(struct drm_crtc *crtc, int mode)
{
struct openchrome_drm_private *dev_private =
@@ -2062,20 +2061,10 @@ via_iga2_crtc_dpms(struct drm_crtc *crtc, int mode)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void
-via_iga2_crtc_disable(struct drm_crtc *crtc)
-{
- DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
- via_iga2_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
-
- DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
static const struct
drm_crtc_helper_funcs openchrome_iga1_drm_crtc_helper_funcs = {
.dpms = via_iga1_crtc_dpms,
- .disable = via_iga1_crtc_disable,
+ .disable = openchrome_crtc_disable,
.prepare = openchrome_crtc_prepare,
.commit = openchrome_crtc_commit,
.mode_fixup = openchrome_crtc_mode_fixup,
@@ -2086,7 +2075,7 @@ drm_crtc_helper_funcs openchrome_iga1_drm_crtc_helper_funcs = {
static const struct
drm_crtc_helper_funcs openchrome_iga2_drm_crtc_helper_funcs = {
.dpms = via_iga2_crtc_dpms,
- .disable = via_iga2_crtc_disable,
+ .disable = openchrome_crtc_disable,
.prepare = openchrome_crtc_prepare,
.commit = openchrome_crtc_commit,
.mode_fixup = openchrome_crtc_mode_fixup,
commit e0c5c1608d301faf60db1609ef9843963edd9aaa
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sat Oct 19 09:40:01 2019 -0700
drm/openchrome: Consolidate CRTC prepare code
It is being merged into openchrome_crtc_prepare().
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 0c8b71b514c4..cafd5db5ea5c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1582,6 +1582,17 @@ drm_mode_crtc_load_lut(struct drm_crtc *crtc)
}
}
+static void openchrome_crtc_prepare(struct drm_crtc *crtc)
+{
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ /* Blank the screen */
+ if (crtc->enabled)
+ crtc->helper_private->dpms(crtc, DRM_MODE_DPMS_OFF);
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
static void openchrome_crtc_commit(struct drm_crtc *crtc)
{
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -2020,18 +2031,6 @@ via_iga1_crtc_disable(struct drm_crtc *crtc)
}
static void
-via_iga1_crtc_prepare(struct drm_crtc *crtc)
-{
- DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
- /* Blank the screen */
- if (crtc->enabled)
- via_iga1_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
-
- DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-static void
via_iga2_crtc_dpms(struct drm_crtc *crtc, int mode)
{
struct openchrome_drm_private *dev_private =
@@ -2073,23 +2072,11 @@ via_iga2_crtc_disable(struct drm_crtc *crtc)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void
-via_iga2_crtc_prepare(struct drm_crtc *crtc)
-{
- DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
- /* Blank the screen */
- if (crtc->enabled)
- via_iga2_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
-
- DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
static const struct
drm_crtc_helper_funcs openchrome_iga1_drm_crtc_helper_funcs = {
.dpms = via_iga1_crtc_dpms,
.disable = via_iga1_crtc_disable,
- .prepare = via_iga1_crtc_prepare,
+ .prepare = openchrome_crtc_prepare,
.commit = openchrome_crtc_commit,
.mode_fixup = openchrome_crtc_mode_fixup,
.mode_set = openchrome_crtc_mode_set,
@@ -2100,7 +2087,7 @@ static const struct
drm_crtc_helper_funcs openchrome_iga2_drm_crtc_helper_funcs = {
.dpms = via_iga2_crtc_dpms,
.disable = via_iga2_crtc_disable,
- .prepare = via_iga2_crtc_prepare,
+ .prepare = openchrome_crtc_prepare,
.commit = openchrome_crtc_commit,
.mode_fixup = openchrome_crtc_mode_fixup,
.mode_set = openchrome_crtc_mode_set,
commit c56426d6a47633135fb947d7d230a26f01a6ab57
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sat Oct 19 09:33:45 2019 -0700
drm/openchrome: Consolidate CRTC commit code
It is being merged into openchrome_crtc_commit().
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 e3f8de6b4471..0c8b71b514c4 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1582,6 +1582,17 @@ drm_mode_crtc_load_lut(struct drm_crtc *crtc)
}
}
+static void openchrome_crtc_commit(struct drm_crtc *crtc)
+{
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ /* Turn on the monitor */
+ if (crtc->enabled)
+ crtc->helper_private->dpms(crtc, DRM_MODE_DPMS_ON);
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
static bool openchrome_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
@@ -2021,18 +2032,6 @@ via_iga1_crtc_prepare(struct drm_crtc *crtc)
}
static void
-via_iga1_crtc_commit(struct drm_crtc *crtc)
-{
- DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
- /* Turn on the monitor */
- if (crtc->enabled)
- via_iga1_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
-
- DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-static void
via_iga2_crtc_dpms(struct drm_crtc *crtc, int mode)
{
struct openchrome_drm_private *dev_private =
@@ -2086,24 +2085,12 @@ via_iga2_crtc_prepare(struct drm_crtc *crtc)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
-static void
-via_iga2_crtc_commit(struct drm_crtc *crtc)
-{
- DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
- /* Turn on the monitor */
- if (crtc->enabled)
- via_iga2_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
-
- DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
static const struct
drm_crtc_helper_funcs openchrome_iga1_drm_crtc_helper_funcs = {
.dpms = via_iga1_crtc_dpms,
.disable = via_iga1_crtc_disable,
.prepare = via_iga1_crtc_prepare,
- .commit = via_iga1_crtc_commit,
+ .commit = openchrome_crtc_commit,
.mode_fixup = openchrome_crtc_mode_fixup,
.mode_set = openchrome_crtc_mode_set,
.mode_set_base_atomic = openchrome_crtc_mode_set_base_atomic,
@@ -2114,7 +2101,7 @@ drm_crtc_helper_funcs openchrome_iga2_drm_crtc_helper_funcs = {
.dpms = via_iga2_crtc_dpms,
.disable = via_iga2_crtc_disable,
.prepare = via_iga2_crtc_prepare,
- .commit = via_iga2_crtc_commit,
+ .commit = openchrome_crtc_commit,
.mode_fixup = openchrome_crtc_mode_fixup,
.mode_set = openchrome_crtc_mode_set,
.mode_set_base_atomic = openchrome_crtc_mode_set_base_atomic,
More information about the openchrome-devel
mailing list