genode/repos/dde_linux/patches/imx8_fb_imx_drm_core.patch

54 lines
1.5 KiB
Diff

imx_drm_core.patch
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 76b782c..a2c3a76 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -43,7 +43,9 @@ static void imx_drm_driver_lastclose(struct drm_device *drm)
{
struct imx_drm_device *imxdrm = drm->dev_private;
+#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
+#endif
}
DEFINE_DRM_GEM_CMA_FOPS(imx_drm_driver_fops);
@@ -120,6 +122,17 @@ static int compare_of(struct device *dev, void *data)
{
struct device_node *np = data;
+ if ((strncmp(dev->driver->name, "imx-dcss-crtc", strlen(dev->driver->name)) == 0) &&
+ (strncmp(np->name, "port", strlen(np->name)) == 0))
+ return 1;
+
+ if ((strncmp(dev->driver->name, "i.mx8-hdp", strlen(dev->driver->name)) == 0) &&
+ (strncmp(np->name, "hdmi", strlen(np->name)) == 0))
+ return 1;
+
+ return 0;
+
+#if 0
/* Special case for DI, dev->of_node may not be set yet */
if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) {
struct ipu_client_platformdata *pdata = dev->platform_data;
@@ -161,6 +174,7 @@ static int compare_of(struct device *dev, void *data)
}
return dev->of_node == np;
+#endif
}
static const char *const imx_drm_dpu_comp_parents[] = {
@@ -416,8 +430,10 @@ static void imx_drm_unbind(struct device *dev)
drm_kms_helper_poll_fini(drm);
+#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
if (imxdrm->fbhelper)
drm_fbdev_cma_fini(imxdrm->fbhelper);
+#endif
drm_mode_config_cleanup(drm);