Commit 70889913 authored by Zhaoxiong Lv's avatar Zhaoxiong Lv Committed by Neil Armstrong

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: default avatarZhaoxiong Lv <lvzhaoxiong@huaqin.corp-partner.google.com>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20240723062615.14796-3-lvzhaoxiong@huaqin.corp-partner.google.comSigned-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240723062615.14796-3-lvzhaoxiong@huaqin.corp-partner.google.com
parent c60ca14b
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <drm/drm_mipi_dsi.h> #include <drm/drm_mipi_dsi.h>
#include <drm/drm_modes.h> #include <drm/drm_modes.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h>
struct boe_th101mb31ig002; struct boe_th101mb31ig002;
...@@ -313,31 +314,15 @@ static int boe_th101mb31ig002_get_modes(struct drm_panel *panel, ...@@ -313,31 +314,15 @@ static int boe_th101mb31ig002_get_modes(struct drm_panel *panel,
struct boe_th101mb31ig002, struct boe_th101mb31ig002,
panel); panel);
const struct drm_display_mode *desc_mode = ctx->desc->modes; 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.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 * TODO: Remove once all drm drivers call
* drm_connector_set_orientation_from_panel() * drm_connector_set_orientation_from_panel()
*/ */
drm_connector_set_panel_orientation(connector, ctx->orientation); drm_connector_set_panel_orientation(connector, ctx->orientation);
drm_mode_probed_add(connector, mode); return drm_connector_helper_get_modes_fixed(connector, desc_mode);
return 1;
} }
static enum drm_panel_orientation static enum drm_panel_orientation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment