diff mbox series

[v4,2/2] drm/panel: boe-th101mb31ig002 : using drm_connector_helper_get_modes_fixed()

Message ID 20240723062615.14796-3-lvzhaoxiong@huaqin.corp-partner.google.com (mailing list archive)
State New, archived
Headers show
Series Modify the method of obtaining porch parameters | expand

Commit Message

Zhaoxiong Lv July 23, 2024, 6:26 a.m. UTC
Use public functions( drm_connector_helper_get_modes_fixed()) to
get porch parameters.

Signed-off-by: Zhaoxiong Lv <lvzhaoxiong@huaqin.corp-partner.google.com>
---
Changes between V4 and V3:
-  1.Modify the return value, return drm_connector_helper_get_modes_fixed(connector, desc_mode).
v3: https://lore.kernel.org/all/20240722092428.24499-3-lvzhaoxiong@huaqin.corp-partner.google.com/

Changes between V3 and V2:
-  1. Keep bpc settings and drm_connector_set_panel_orientation() function..
v2: https://lore.kernel.org/all/20240716121112.14435-3-lvzhaoxiong@huaqin.corp-partner.google.com/
---
 .../drm/panel/panel-boe-th101mb31ig002-28a.c  | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

Comments

Doug Anderson July 23, 2024, 7:48 p.m. UTC | #1
Hi,

On Mon, Jul 22, 2024 at 11:26 PM Zhaoxiong Lv
<lvzhaoxiong@huaqin.corp-partner.google.com> wrote:
>
> Use public functions( drm_connector_helper_get_modes_fixed()) to
> get porch parameters.
>
> Signed-off-by: Zhaoxiong Lv <lvzhaoxiong@huaqin.corp-partner.google.com>
> ---
> Changes between V4 and V3:
> -  1.Modify the return value, return drm_connector_helper_get_modes_fixed(connector, desc_mode).
> v3: https://lore.kernel.org/all/20240722092428.24499-3-lvzhaoxiong@huaqin.corp-partner.google.com/
>
> Changes between V3 and V2:
> -  1. Keep bpc settings and drm_connector_set_panel_orientation() function..
> v2: https://lore.kernel.org/all/20240716121112.14435-3-lvzhaoxiong@huaqin.corp-partner.google.com/
> ---
>  .../drm/panel/panel-boe-th101mb31ig002-28a.c  | 19 ++-----------------
>  1 file changed, 2 insertions(+), 17 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

I'd assume that Neil or Jessica will apply these two patches assuming
they agree it looks OK. If this is stagnant for a while then I'll
apply it.

-Doug
Neil Armstrong July 24, 2024, 7:58 a.m. UTC | #2
Hi Doug,

On 23/07/2024 21:48, Doug Anderson wrote:
> Hi,
> 
> On Mon, Jul 22, 2024 at 11:26 PM Zhaoxiong Lv
> <lvzhaoxiong@huaqin.corp-partner.google.com> wrote:
>>
>> Use public functions( drm_connector_helper_get_modes_fixed()) to
>> get porch parameters.
>>
>> Signed-off-by: Zhaoxiong Lv <lvzhaoxiong@huaqin.corp-partner.google.com>
>> ---
>> Changes between V4 and V3:
>> -  1.Modify the return value, return drm_connector_helper_get_modes_fixed(connector, desc_mode).
>> v3: https://lore.kernel.org/all/20240722092428.24499-3-lvzhaoxiong@huaqin.corp-partner.google.com/
>>
>> Changes between V3 and V2:
>> -  1. Keep bpc settings and drm_connector_set_panel_orientation() function..
>> v2: https://lore.kernel.org/all/20240716121112.14435-3-lvzhaoxiong@huaqin.corp-partner.google.com/
>> ---
>>   .../drm/panel/panel-boe-th101mb31ig002-28a.c  | 19 ++-----------------
>>   1 file changed, 2 insertions(+), 17 deletions(-)
> 
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> 
> I'd assume that Neil or Jessica will apply these two patches assuming
> they agree it looks OK. If this is stagnant for a while then I'll
> apply it.

Thanks for the review, I'm still working this week so I'll apply this serie,
but I'll be off for the next 3 weeks so feel free to apply reviewed panel patches
while I'm away (I'll still be pingable on irc if needed!)

Thanks,
Neil

> 
> -Doug
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c
index d4e4abd103bb..0b87f1e6ecae 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,15 @@  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