[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD=FV=VZ8SuBnPjSTLeCjPUnzFxgTkxUb+BC5+nKs9ECiy3zsw@mail.gmail.com>
Date: Mon, 22 Jul 2024 10:39:05 -0700
From: Doug Anderson <dianders@...omium.org>
To: Zhaoxiong Lv <lvzhaoxiong@...qin.corp-partner.google.com>
Cc: neil.armstrong@...aro.org, quic_jesszhan@...cinc.com, sam@...nborg.org,
maarten.lankhorst@...ux.intel.com, mripard@...nel.org, tzimmermann@...e.de,
hsinyi@...gle.com, awarnecke002@...mail.com, dmitry.baryshkov@...aro.org,
dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/2] drm/panel: boe-th101mb31ig002 : using drm_connector_helper_get_modes_fixed()
Hi,
On Mon, Jul 22, 2024 at 2:24 AM Zhaoxiong Lv
<lvzhaoxiong@...qin.corp-partner.google.com> wrote:
>
> @@ -313,29 +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);
> + drm_connector_helper_get_modes_fixed(connector, desc_mode);
>
> return 1;
Don't always return 1. This should be:
return drm_connector_helper_get_modes_fixed(connector, desc_mode);
...so if it fails to add a mode then you'll return 0.
-Doug
Powered by blists - more mailing lists