drivers/gpu/drm/openchrome/openchrome_crtc.c | 186 ++++++++++++------------ drivers/gpu/drm/openchrome/openchrome_display.c | 16 -- drivers/gpu/drm/openchrome/openchrome_drv.c | 6 drivers/gpu/drm/openchrome/openchrome_drv.h | 9 - drivers/gpu/drm/openchrome/openchrome_init.c | 20 +- 5 files changed, 110 insertions(+), 127 deletions(-)
New commits: commit 4d7180297bbdcaf665815a41a4d713187eedf425 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Sep 8 13:01:18 2020 -0700 drm/openchrome: Version bumped to 3.3.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 408519b33f4e..5c1f15b8aa33 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 3 -#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 "20200824" +#define DRIVER_DATE "20200908" #define DRIVER_AUTHOR "OpenChrome Project" commit f98964ffdb3279f4b0bce83717c5fbb6461c1c19 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Sep 8 12:57:48 2020 -0700 drm/openchrome: Omit KMS check before initializing KMS Checking for KMS is not really necessary since the code itself knows that it supports KMS. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c index bec5563ca74a..cdbf293c4bc5 100644 --- a/drivers/gpu/drm/openchrome/openchrome_drv.c +++ b/drivers/gpu/drm/openchrome/openchrome_drv.c @@ -191,12 +191,10 @@ static int openchrome_driver_load(struct drm_device *dev, chip_revision_info(dev_private); - if (drm_core_check_feature(dev, DRIVER_MODESET)) { - ret = via_modeset_init(dev); - if (ret) { + ret = via_modeset_init(dev); + if (ret) { DRM_ERROR("Failed to initialize mode setting.\n"); goto init_error; - } } goto exit; commit bf0cb30e42bab2c5c17cf765af37f75e2e118459 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Sep 8 12:57:33 2020 -0700 drm/openchrome: Use drm_mode_config_cleanup() for teardown drm_mode_config_cleanup() is already being called when tearing down various initialized resources, so stop doing it ourselves inside via_modeset_fini(). Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c index 770036b50c0e..63cee530bc45 100644 --- a/drivers/gpu/drm/openchrome/openchrome_display.c +++ b/drivers/gpu/drm/openchrome/openchrome_display.c @@ -517,23 +517,11 @@ exit: void via_modeset_fini(struct drm_device *dev) { - struct drm_connector *connector, *ot; - struct drm_encoder *encoder, *enct; - drm_kms_helper_poll_fini(dev); via_fbdev_fini(dev); drm_helper_force_disable_all(dev); - /* We need to cleanup the connectors before the encoders */ - list_for_each_entry_safe(connector, ot, - &dev->mode_config.connector_list, head) - connector->funcs->destroy(connector); - - list_for_each_entry_safe(encoder, enct, - &dev->mode_config.encoder_list, head) - encoder->funcs->destroy(encoder); - drm_mode_config_cleanup(dev); via_i2c_exit(); commit 91f07366b4349fc86e46cca5a9a5431fe2eba93c Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Sep 8 12:57:16 2020 -0700 drm/openchrome: Ignore DPMS properties when tearing down Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c index 06efeaf3331b..770036b50c0e 100644 --- a/drivers/gpu/drm/openchrome/openchrome_display.c +++ b/drivers/gpu/drm/openchrome/openchrome_display.c @@ -523,10 +523,6 @@ void via_modeset_fini(struct drm_device *dev) drm_kms_helper_poll_fini(dev); via_fbdev_fini(dev); - /* drm_mode_config_init has not been called yet */ - if (!dev->mode_config.dpms_property) - return; - drm_helper_force_disable_all(dev); /* We need to cleanup the connectors before the encoders */ commit 8cdbfddbb19ce4740efb53062f1814ca3dedf2a8 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Sep 8 12:56:58 2020 -0700 drm/openchrome: Forcibly turn off all enabled CRTCs when tearing down Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c index 32d2d5746786..06efeaf3331b 100644 --- a/drivers/gpu/drm/openchrome/openchrome_display.c +++ b/drivers/gpu/drm/openchrome/openchrome_display.c @@ -527,6 +527,8 @@ void via_modeset_fini(struct drm_device *dev) if (!dev->mode_config.dpms_property) return; + drm_helper_force_disable_all(dev); + /* We need to cleanup the connectors before the encoders */ list_for_each_entry_safe(connector, ot, &dev->mode_config.connector_list, head) commit 69af1db05e8e4c18d69d8596781beb9b1bf4c0ca Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Sep 8 12:56:44 2020 -0700 drm/openchrome: Declare openchrome_crtc_param_init() as a static type Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c index 3610c37c8cca..d234ca8d61ec 100644 --- a/drivers/gpu/drm/openchrome/openchrome_crtc.c +++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c @@ -2063,99 +2063,9 @@ drm_crtc_helper_funcs openchrome_drm_crtc_helper_funcs = { .mode_set_base_atomic = openchrome_crtc_mode_set_base_atomic, }; -static const uint32_t openchrome_primary_formats[] = { - DRM_FORMAT_XRGB8888, - DRM_FORMAT_ARGB8888, - DRM_FORMAT_RGB888, - DRM_FORMAT_RGB565, - DRM_FORMAT_RGB332, -}; - -int openchrome_crtc_init(struct openchrome_drm_private *dev_private, - uint32_t index) -{ - struct drm_device *dev = dev_private->dev; - struct via_crtc *iga; - struct drm_plane *primary; - struct drm_plane *cursor; - uint32_t possible_crtcs; - int ret; - - possible_crtcs = 1 << index; - - primary = kzalloc(sizeof(struct drm_plane), GFP_KERNEL); - if (!primary) { - ret = -ENOMEM; - DRM_ERROR("Failed to allocate a primary plane.\n"); - goto exit; - } - - ret = drm_universal_plane_init(dev, primary, possible_crtcs, - &drm_primary_helper_funcs, - openchrome_primary_formats, - ARRAY_SIZE(openchrome_primary_formats), - NULL, DRM_PLANE_TYPE_PRIMARY, NULL); - if (ret) { - DRM_ERROR("Failed to initialize a primary " - "plane.\n"); - goto free_primary; - } - - cursor = kzalloc(sizeof(struct drm_plane), GFP_KERNEL); - if (!cursor) { - ret = -ENOMEM; - DRM_ERROR("Failed to allocate a cursor plane.\n"); - goto cleanup_primary; - } - - ret = drm_universal_plane_init(dev, cursor, possible_crtcs, - &openchrome_cursor_drm_plane_funcs, - openchrome_cursor_formats, - openchrome_cursor_formats_size, - NULL, DRM_PLANE_TYPE_CURSOR, NULL); - if (ret) { - DRM_ERROR("Failed to initialize a cursor " - "plane.\n"); - goto free_cursor; - } - - iga = kzalloc(sizeof(struct via_crtc), GFP_KERNEL); - if (!iga) { - ret = -ENOMEM; - DRM_ERROR("Failed to allocate CRTC storage.\n"); - goto cleanup_cursor; - } - - drm_crtc_helper_add(&iga->base, - &openchrome_drm_crtc_helper_funcs); - ret = drm_crtc_init_with_planes(dev, &iga->base, - primary, cursor, - &openchrome_drm_crtc_funcs, - NULL); - if (ret) { - DRM_ERROR("Failed to initialize CRTC!\n"); - goto free_crtc; - } - 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: - return ret; -} - -void openchrome_crtc_param_init( +static void openchrome_crtc_param_init( struct openchrome_drm_private *dev_private, struct drm_crtc *crtc, uint32_t index) @@ -2325,3 +2235,97 @@ void openchrome_crtc_param_init( gamma[i + 512] = i << 8 | i; } } + + + +static const uint32_t openchrome_primary_formats[] = { + DRM_FORMAT_XRGB8888, + DRM_FORMAT_ARGB8888, + DRM_FORMAT_RGB888, + DRM_FORMAT_RGB565, + DRM_FORMAT_RGB332, +}; + +int openchrome_crtc_init(struct openchrome_drm_private *dev_private, + uint32_t index) +{ + struct drm_device *dev = dev_private->dev; + struct via_crtc *iga; + struct drm_plane *primary; + struct drm_plane *cursor; + uint32_t possible_crtcs; + int ret; + + possible_crtcs = 1 << index; + + primary = kzalloc(sizeof(struct drm_plane), GFP_KERNEL); + if (!primary) { + ret = -ENOMEM; + DRM_ERROR("Failed to allocate a primary plane.\n"); + goto exit; + } + + ret = drm_universal_plane_init(dev, primary, possible_crtcs, + &drm_primary_helper_funcs, + openchrome_primary_formats, + ARRAY_SIZE(openchrome_primary_formats), + NULL, DRM_PLANE_TYPE_PRIMARY, NULL); + if (ret) { + DRM_ERROR("Failed to initialize a primary " + "plane.\n"); + goto free_primary; + } + + cursor = kzalloc(sizeof(struct drm_plane), GFP_KERNEL); + if (!cursor) { + ret = -ENOMEM; + DRM_ERROR("Failed to allocate a cursor plane.\n"); + goto cleanup_primary; + } + + ret = drm_universal_plane_init(dev, cursor, possible_crtcs, + &openchrome_cursor_drm_plane_funcs, + openchrome_cursor_formats, + openchrome_cursor_formats_size, + NULL, DRM_PLANE_TYPE_CURSOR, NULL); + if (ret) { + DRM_ERROR("Failed to initialize a cursor " + "plane.\n"); + goto free_cursor; + } + + iga = kzalloc(sizeof(struct via_crtc), GFP_KERNEL); + if (!iga) { + ret = -ENOMEM; + DRM_ERROR("Failed to allocate CRTC storage.\n"); + goto cleanup_cursor; + } + + drm_crtc_helper_add(&iga->base, + &openchrome_drm_crtc_helper_funcs); + ret = drm_crtc_init_with_planes(dev, &iga->base, + primary, cursor, + &openchrome_drm_crtc_funcs, + NULL); + if (ret) { + DRM_ERROR("Failed to initialize CRTC!\n"); + goto free_crtc; + } + + 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: + return ret; +} diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h index adf5e9ac99c5..408519b33f4e 100644 --- a/drivers/gpu/drm/openchrome/openchrome_drv.h +++ b/drivers/gpu/drm/openchrome/openchrome_drv.h @@ -463,10 +463,6 @@ 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); -void openchrome_crtc_param_init( - struct openchrome_drm_private *dev_private, - struct drm_crtc *crtc, - uint32_t index); /* encoders */ extern void via_set_sync_polarity(struct drm_encoder *encoder, commit 268c0c850c067fa5791a45f5a4359e8900eef2e4 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Sep 8 12:56:33 2020 -0700 drm/openchrome: Declare openchrome_flag_init() as a static type 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 c49eb60bf1cf..adf5e9ac99c5 100644 --- a/drivers/gpu/drm/openchrome/openchrome_drv.h +++ b/drivers/gpu/drm/openchrome/openchrome_drv.h @@ -392,7 +392,6 @@ 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); -void openchrome_flag_init(struct openchrome_drm_private *dev_private); int openchrome_device_init(struct openchrome_drm_private *dev_private); int openchrome_dev_pm_ops_suspend(struct device *dev); diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c index 46a7838f2668..f7f9f49bbe65 100644 --- a/drivers/gpu/drm/openchrome/openchrome_init.c +++ b/drivers/gpu/drm/openchrome/openchrome_init.c @@ -974,6 +974,16 @@ out_err: return ret; } +static void openchrome_flag_init(struct openchrome_drm_private *dev_private) +{ + DRM_DEBUG_KMS("Entered %s.\n", __func__); + + /* Set this flag for ttm_bo_device_init. */ + dev_private->need_dma32 = true; + + DRM_DEBUG_KMS("Exiting %s.\n", __func__); +} + static void openchrome_quirks_init( struct openchrome_drm_private *dev_private) { @@ -1186,16 +1196,6 @@ void chip_revision_info(struct openchrome_drm_private *dev_private) DRM_DEBUG_KMS("Exiting %s.\n", __func__); } -void openchrome_flag_init(struct openchrome_drm_private *dev_private) -{ - DRM_DEBUG_KMS("Entered %s.\n", __func__); - - /* Set this flag for ttm_bo_device_init. */ - dev_private->need_dma32 = true; - - DRM_DEBUG_KMS("Exiting %s.\n", __func__); -} - int openchrome_device_init(struct openchrome_drm_private *dev_private) { int ret; _______________________________________________ openchrome-devel mailing list openchrome-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/openchrome-devel