RK3588 Android12强制HDMI输出特殊分辨率timing

1.把白名单去掉,device/rockchip/common/device.mk中如下位置注释掉
  PRODUCT_COPY_FILES += \
      $(TARGET_DEVICE_DIR)/resolution_white.xml:/system/usr/share/resolution_white.xml
2.安照下面补丁修改,在kernel-5.10/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c的默认数组中dw_hdmi_default_modes[] 加入分辨率3840x1436
将数组kernel-5.10/drivers/gpu/drm/drm_edid.c的edid_cea_modes_1[]第127个替换成需要修改的分辨率timming

3.在屏参中打开hdmi0,将hdmi0_mode改为127,这里主要是实现将kernel-5.10/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c里面的dw_hdmi_connector_get_modes函数选用强制修改的HDMI屏参数timing。

diff --git a/kernel-5.10/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/kernel-5.10/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index badaee53fe..fca19a43dd 100644
--- a/kernel-5.10/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/kernel-5.10/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -170,6 +170,11 @@ static const struct drm_display_mode dw_hdmi_default_modes[] = {
                   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
                   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
           .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
+               /* 127 - 3840x1436@30Hz 16:9 */
+       { DRM_MODE("3840x1436", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
+                  4104, 4400, 0, 1436, 2168, 2178, 2250, 0,
+                  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+          .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
 };

 enum frl_mask {
@@ -2117,6 +2122,9 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
                                case 97:
                                                def_index=7;
                                                break;
+                               case 127:
+                                               def_index=9;
+                                               break;
                                default:
                                                def_index=1;
                                                break;
diff --git a/kernel-5.10/drivers/gpu/drm/drm_edid.c b/kernel-5.10/drivers/gpu/drm/drm_edid.c
index 4fdfb41b91..640f6ffd7e 100644
--- a/kernel-5.10/drivers/gpu/drm/drm_edid.c
+++ b/kernel-5.10/drivers/gpu/drm/drm_edid.c
@@ -1372,10 +1372,15 @@ static const struct drm_display_mode edid_cea_modes_1[] = {
                   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
          .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
        /* 127 - 5120x2160@100Hz 64:27 */
-       { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 1485000, 5120, 6216,
-                  6304, 6600, 0, 2160, 2168, 2178, 2250, 0,
+       // { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 1485000, 5120, 6216,
+       //         6304, 6600, 0, 2160, 2168, 2178, 2250, 0,
+       //         DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+       //   .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+                       /* 128 - 3840x1436@30Hz 16:9 */
+       { DRM_MODE("3840x1436", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
+                  4104, 4400, 0, 1436, 2168, 2178, 2250, 0,
                   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
-         .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+          .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
 };


 

你可能感兴趣的:(android)