[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240716121112.14435-3-lvzhaoxiong@huaqin.corp-partner.google.com>
Date: Tue, 16 Jul 2024 20:11:12 +0800
From: Zhaoxiong Lv <lvzhaoxiong@...qin.corp-partner.google.com>
To: neil.armstrong@...aro.org,
robh@...nel.org,
krzysztof.kozlowski+dt@...aro.org,
conor+dt@...nel.org,
airlied@...il.com,
mripard@...nel.org,
dianders@...omium.org,
hsinyi@...gle.com,
awarnecke002@...mail.com,
quic_jesszhan@...cinc.com,
dmitry.baryshkov@...aro.org
Cc: dri-devel@...ts.freedesktop.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Zhaoxiong Lv <lvzhaoxiong@...qin.corp-partner.google.com>
Subject: [PATCH v2 2/2] drm/panel: boe-th101mb31ig002 : using drm_connector_helper_get_modes_fixed()
Use public functions(drm_connector_helper_get_modes_fixed()) to
get porch parameters.
Signed-off-by: Zhaoxiong Lv <lvzhaoxiong@...qin.corp-partner.google.com>
---
.../drm/panel/panel-boe-th101mb31ig002-28a.c | 26 ++-----------------
1 file changed, 2 insertions(+), 24 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c
index d4e4abd103bb..4a61a11099b6 100644
--- a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c
+++ b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c
@@ -16,6 +16,7 @@
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
struct boe_th101mb31ig002;
@@ -313,31 +314,8 @@ static int boe_th101mb31ig002_get_modes(struct drm_panel *panel,
struct boe_th101mb31ig002,
panel);
const struct drm_display_mode *desc_mode = ctx->desc->modes;
- struct drm_display_mode *mode;
- mode = drm_mode_duplicate(connector->dev, desc_mode);
- if (!mode) {
- dev_err(panel->dev, "Failed to add mode %ux%u@%u\n",
- desc_mode->hdisplay, desc_mode->vdisplay,
- drm_mode_vrefresh(desc_mode));
- return -ENOMEM;
- }
-
- drm_mode_set_name(mode);
-
- connector->display_info.bpc = 8;
- connector->display_info.width_mm = mode->width_mm;
- connector->display_info.height_mm = mode->height_mm;
-
- /*
- * TODO: Remove once all drm drivers call
- * drm_connector_set_orientation_from_panel()
- */
- drm_connector_set_panel_orientation(connector, ctx->orientation);
-
- drm_mode_probed_add(connector, mode);
-
- return 1;
+ return drm_connector_helper_get_modes_fixed(connector, desc_mode);
}
static enum drm_panel_orientation
--
2.17.1
Powered by blists - more mailing lists