drivers/gpu/drm/openchrome/openchrome_crtc.c    |   64 +++++++-----------------
 drivers/gpu/drm/openchrome/openchrome_display.c |   26 +--------
 drivers/gpu/drm/openchrome/openchrome_drv.h     |   11 +---
 3 files changed, 25 insertions(+), 76 deletions(-)

New commits:
commit d7ef4c5017cbc434c8be8a03af78fe73dd13fdf5
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Mon Nov 9 09:12:07 2020 -0800

    drm/openchrome: Version bumped to 3.4.2
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 1ddc1cf4f7d0..812da9f64c3a 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           4
-#define DRIVER_PATCHLEVEL      1
+#define DRIVER_PATCHLEVEL      2
 #define DRIVER_NAME            "openchrome"
 #define DRIVER_DESC            "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE            "20201027"
+#define DRIVER_DATE            "20201109"
 #define DRIVER_AUTHOR          "OpenChrome Project"
 
 
commit 1e96451aeee4d0bf248408df33c0017849770446
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Mon Nov 9 09:10:25 2020 -0800

    Revert "drm/openchrome: Initialize plane and crtc separately"
    
    This reverts commit e3a26f777b06e0d8a02868cbd2916484b51da940.

diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c 
b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index b8499e21aa34..fcce3fbbe33a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -2239,23 +2239,17 @@ static const uint32_t openchrome_primary_formats[] = {
        DRM_FORMAT_RGB332,
 };
 
-int openchrome_plane_init(struct openchrome_drm_private *dev_private,
-                               struct drm_plane **p_primary,
-                               struct drm_plane **p_cursor)
+int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
+                               uint32_t index)
 {
        struct drm_device *dev = dev_private->dev;
-       struct drm_plane *primary = NULL;
-       struct drm_plane *cursor = NULL;
+       struct via_crtc *iga;
+       struct drm_plane *primary;
+       struct drm_plane *cursor;
        uint32_t possible_crtcs;
-       uint32_t i;
        int ret;
 
-       DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-       possible_crtcs = 0;
-       for (i = 0; i < OPENCHROME_MAX_CRTC; i++) {
-               possible_crtcs |= 1 << i;
-       }
+       possible_crtcs = 1 << index;
 
        primary = kzalloc(sizeof(struct drm_plane), GFP_KERNEL);
        if (!primary) {
@@ -2293,43 +2287,15 @@ int openchrome_plane_init(struct openchrome_drm_private 
*dev_private,
                goto free_cursor;
        }
 
-       goto exit;
-free_cursor:
-       kfree(cursor);
-       cursor = NULL;
-cleanup_primary:
-       drm_plane_cleanup(primary);
-free_primary:
-       kfree(primary);
-       primary = NULL;
-exit:
-       *p_primary = primary;
-       *p_cursor = cursor;
-
-       DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-       return ret;
-}
-
-int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
-                               struct drm_plane *primary,
-                               struct drm_plane *cursor,
-                               uint32_t i)
-{
-       struct drm_device *dev = dev_private->dev;
-       struct via_crtc *iga;
-       int ret;
-
-       DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
        iga = kzalloc(sizeof(struct via_crtc), GFP_KERNEL);
        if (!iga) {
                ret = -ENOMEM;
                DRM_ERROR("Failed to allocate CRTC storage.\n");
-               goto exit;
+               goto cleanup_cursor;
        }
 
        drm_crtc_helper_add(&iga->base,
-                               &openchrome_drm_crtc_helper_funcs);
+                       &openchrome_drm_crtc_helper_funcs);
        ret = drm_crtc_init_with_planes(dev, &iga->base,
                                        primary, cursor,
                                        &openchrome_drm_crtc_funcs,
@@ -2339,12 +2305,20 @@ int openchrome_crtc_init(struct openchrome_drm_private 
*dev_private,
                goto free_crtc;
        }
 
-       iga->index = i;
-       openchrome_crtc_param_init(dev_private, &iga->base, i);
+       iga->index = index;
+
+       openchrome_crtc_param_init(dev_private, &iga->base, index);
        goto exit;
 free_crtc:
        kfree(iga);
+cleanup_cursor:
+       drm_plane_cleanup(cursor);
+free_cursor:
+       kfree(cursor);
+cleanup_primary:
+       drm_plane_cleanup(primary);
+free_primary:
+       kfree(primary);
 exit:
-       DRM_DEBUG_KMS("Exiting %s.\n", __func__);
        return ret;
 }
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c 
b/drivers/gpu/drm/openchrome/openchrome_display.c
index 36c65df1c7d4..a7ebc4926a4b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -460,13 +460,9 @@ int
 via_modeset_init(struct drm_device *dev)
 {
        struct openchrome_drm_private *dev_private = dev->dev_private;
-       struct drm_plane *primary;
-       struct drm_plane *cursor;
        uint32_t i;
        int ret = 0;
 
-       DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
        openchrome_mode_config_init(dev_private);
 
        /* Initialize the number of display connectors. */
@@ -484,20 +480,10 @@ via_modeset_init(struct drm_device *dev)
 
        via_hwcursor_init(dev_private);
 
-       ret = openchrome_plane_init(dev_private, &primary, &cursor);
-       if (ret) {
-               DRM_ERROR("Failed to initialize planes!\n");
-               goto free_i2c;
-       }
-
        for (i = 0; i < OPENCHROME_MAX_CRTC; i++) {
-               ret = openchrome_crtc_init(dev_private,
-                                               primary,
-                                               cursor,
-                                               i);
+               ret = openchrome_crtc_init(dev_private, i);
                if (ret) {
-                       DRM_ERROR("Failed to initialize CRTC!\n");
-                       goto free_crtc;
+                       goto exit;
                }
        }
 
@@ -527,17 +513,11 @@ via_modeset_init(struct drm_device *dev)
        /* Initialize the frame buffer device. */
        ret = openchrome_fb_init(dev);
        if (ret) {
-               goto free_crtc;
+               goto exit;
        }
 
        drm_kms_helper_poll_init(dev);
-       goto exit;
-free_crtc:
-       drm_mode_config_cleanup(dev);
-free_i2c:
-       via_i2c_exit();
 exit:
-       DRM_DEBUG_KMS("Exiting %s.\n", __func__);
        return ret;
 }
 
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index f6214933157e..1ddc1cf4f7d0 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -453,13 +453,8 @@ extern void openchrome_fb_fini(struct drm_device *dev);
 /* crtc */
 extern void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
                                        struct drm_display_mode *mode);
-int openchrome_plane_init(struct openchrome_drm_private *dev_private,
-                               struct drm_plane **p_primary,
-                               struct drm_plane **p_cursor);
 int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
-                               struct drm_plane *primary,
-                               struct drm_plane *cursor,
-                               uint32_t i);
+                               uint32_t index);
 
 /* encoders */
 extern void via_set_sync_polarity(struct drm_encoder *encoder,
_______________________________________________
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel

Reply via email to