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 | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 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 236b0dd..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,
@@ -437,6 +454,16 @@
} else {
s->output_if |= dp->id ? VOP_OUTPUT_IF_eDP1 : VOP_OUTPUT_IF_eDP0;
}
+
+ if (dp->plat_data.dual_connector_split) {
+ s->output_flags |= ROCKCHIP_OUTPUT_DUAL_CONNECTOR_SPLIT_MODE;
+
+ if (dp->plat_data.left_display)
+ s->output_if_left_panel |= dp->id ?
+ VOP_OUTPUT_IF_eDP1 :
+ VOP_OUTPUT_IF_eDP0;
+ }
+
s->output_bpc = di->bpc;
s->bus_flags = di->bus_flags;
s->tv_state = &conn_state->tv;
@@ -474,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,
@@ -671,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;
}
@@ -678,6 +707,12 @@
device_property_read_u32(dev, "min-refresh-rate", &dp->min_refresh_rate);
device_property_read_u32(dev, "max-refresh-rate", &dp->max_refresh_rate);
+ if (dp->data->split_mode && device_property_read_bool(dev, "dual-connector-split")) {
+ dp->plat_data.dual_connector_split = true;
+ if (device_property_read_bool(dev, "left-display"))
+ dp->plat_data.left_display = true;
+ }
+
ret = component_add(dev, &rockchip_dp_component_ops);
if (ret)
goto err_dp_remove;
--
Gitblit v1.6.2