From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/kernel/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/kernel/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index e15c50e..9f09525 100644
--- a/kernel/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/kernel/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -314,6 +314,23 @@
rockchip_drm_unregister_sub_dev(sdev);
}
+static enum drm_mode_status
+rockchip_dp_drm_encoder_mode_valid(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode)
+{
+ struct rockchip_dp_device *dp = to_dp(encoder);
+ struct videomode vm;
+
+ drm_display_mode_to_videomode(mode, &vm);
+
+ if (!vm.hfront_porch || !vm.hback_porch || !vm.vfront_porch || !vm.vback_porch) {
+ DRM_DEV_ERROR(dp->dev, "front porch or back porch can not be 0\n");
+ return MODE_BAD;
+ }
+
+ return MODE_OK;
+}
+
static bool
rockchip_dp_drm_encoder_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
@@ -484,6 +501,7 @@
}
static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
+ .mode_valid = rockchip_dp_drm_encoder_mode_valid,
.mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
.mode_set = rockchip_dp_drm_encoder_mode_set,
.atomic_enable = rockchip_dp_drm_encoder_enable,
@@ -681,6 +699,7 @@
dp->plat_data.right = secondary->adp;
dp->plat_data.split_mode = true;
+ secondary->plat_data.panel = dp->plat_data.panel;
secondary->plat_data.left = dp->adp;
secondary->plat_data.split_mode = true;
}
--
Gitblit v1.6.2