[openchrome-devel] drm-openchrome: Branch 'drm-next-5.18' - 4 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Wed Feb 9 23:22:10 UTC 2022
drivers/gpu/drm/openchrome/openchrome_crtc.c | 37 +++++++++++++++++----------
drivers/gpu/drm/openchrome/openchrome_drv.h | 4 +-
2 files changed, 26 insertions(+), 15 deletions(-)
New commits:
commit 01c7f004b9b1ee9adbaf52110169f30462f659a9
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Feb 9 17:24:26 2022 -0600
drm/openchrome: Version bumped to 3.4.18
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 b63c08bb39c0..02fa1e541fce 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 17
+#define DRIVER_PATCHLEVEL 18
#define DRIVER_NAME "openchrome"
#define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20220201"
+#define DRIVER_DATE "20220209"
#define DRIVER_AUTHOR "OpenChrome Project"
commit b2f6678bea99f04ab755daa9b65d25009e57a6c9
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Feb 9 17:21:28 2022 -0600
drm/openchrome: No longer check for color depth in *_atomic_update()
This was done inside openchrome_primary_atomic_update(). It should
probably be done somewhere else.
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 6afb98007c75..876cdb422442 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1924,14 +1924,6 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- if ((fb->format->depth != 8) && (fb->format->depth != 16) &&
- (fb->format->depth != 24)) {
- DRM_ERROR("Unsupported IGA%s Color Depth: %d bit\n",
- (!iga->index) ? "1" : "2",
- fb->format->depth);
- goto exit;
- }
-
gem = fb->obj[0];
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
bo = container_of(ttm_bo, struct openchrome_bo, ttm_bo);
@@ -1983,7 +1975,6 @@ void openchrome_primary_atomic_update(struct drm_plane *plane,
load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
}
-exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
commit 8c494eb6e81d041eb15ccc5b9c6da218686afca8
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Feb 9 17:20:20 2022 -0600
drm/openchrome: Check for drm_mode_crtc_set_gamma_size() return type
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 882c4ba0a810..6afb98007c75 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -2227,14 +2227,19 @@ static void openchrome_crtc_param_init(
}
}
-static void openchrome_gamma_init(struct drm_crtc *crtc)
+static int openchrome_gamma_init(struct drm_crtc *crtc)
{
u16 *gamma;
uint32_t i;
+ int ret;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- drm_mode_crtc_set_gamma_size(crtc, 256);
+ ret = drm_mode_crtc_set_gamma_size(crtc, 256);
+ if (ret) {
+ DRM_ERROR("Failed to set gamma size!\n");
+ goto exit;
+ }
gamma = crtc->gamma_store;
for (i = 0; i < 256; i++) {
@@ -2243,7 +2248,9 @@ static void openchrome_gamma_init(struct drm_crtc *crtc)
gamma[i + 512] = i << 8 | i;
}
+exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+ return ret;
}
static const uint32_t openchrome_primary_formats[] = {
@@ -2327,7 +2334,11 @@ int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
iga->index = index;
openchrome_crtc_param_init(dev_private, &iga->base, index);
- openchrome_gamma_init(&iga->base);
+ ret = openchrome_gamma_init(&iga->base);
+ if (ret) {
+ goto free_crtc;
+ }
+
goto exit;
free_crtc:
kfree(iga);
commit 2d2984ae00795078fa654188d31824e95ed7aada
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Wed Feb 9 17:18:51 2022 -0600
drm/openchrome: Perform gamma initialization in openchrome_gamma_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 ce23075bb9e6..882c4ba0a810 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -2075,8 +2075,6 @@ static void openchrome_crtc_param_init(
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- u16 *gamma;
- uint32_t i;
if (iga->index) {
iga->timings.htotal.count = ARRAY_SIZE(iga2_hor_total);
@@ -2227,15 +2225,25 @@ static void openchrome_crtc_param_init(
iga->offset.count = ARRAY_SIZE(iga1_offset);
iga->offset.regs = iga1_offset;
}
+}
+
+static void openchrome_gamma_init(struct drm_crtc *crtc)
+{
+ u16 *gamma;
+ uint32_t i;
+
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
drm_mode_crtc_set_gamma_size(crtc, 256);
- gamma = crtc->gamma_store;
+ gamma = crtc->gamma_store;
for (i = 0; i < 256; i++) {
gamma[i] = i << 8 | i;
gamma[i + 256] = i << 8 | i;
gamma[i + 512] = i << 8 | i;
}
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
static const uint32_t openchrome_primary_formats[] = {
@@ -2319,6 +2327,7 @@ int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
iga->index = index;
openchrome_crtc_param_init(dev_private, &iga->base, index);
+ openchrome_gamma_init(&iga->base);
goto exit;
free_crtc:
kfree(iga);
More information about the openchrome-devel
mailing list