Commit 4914cbc4 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Neil Armstrong

drm/bridge: lt9611: stop filtering modes via the table

The lt9611 bridge can support different modes, it makes no sense to list
them in the table. Drop the table and check the number of interfaces
using the fixed value.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-13-dmitry.baryshkov@linaro.org
parent 84cf74d9
......@@ -84,24 +84,6 @@ static const struct regmap_config lt9611_regmap_config = {
.num_ranges = ARRAY_SIZE(lt9611_ranges),
};
struct lt9611_mode {
u16 hdisplay;
u16 vdisplay;
u8 vrefresh;
u8 lanes;
u8 intfs;
};
static struct lt9611_mode lt9611_modes[] = {
{ 3840, 2160, 30, 4, 2 }, /* 3840x2160 24bit 30Hz 4Lane 2ports */
{ 1920, 1080, 60, 4, 1 }, /* 1080P 24bit 60Hz 4lane 1port */
{ 1920, 1080, 30, 3, 1 }, /* 1080P 24bit 30Hz 3lane 1port */
{ 1920, 1080, 24, 3, 1 },
{ 720, 480, 60, 4, 1 },
{ 720, 576, 50, 2, 1 },
{ 640, 480, 60, 2, 1 },
};
static struct lt9611 *bridge_to_lt9611(struct drm_bridge *bridge)
{
return container_of(bridge, struct lt9611, bridge);
......@@ -604,21 +586,6 @@ static int lt9611_regulator_enable(struct lt9611 *lt9611)
return 0;
}
static struct lt9611_mode *lt9611_find_mode(const struct drm_display_mode *mode)
{
int i;
for (i = 0; i < ARRAY_SIZE(lt9611_modes); i++) {
if (lt9611_modes[i].hdisplay == mode->hdisplay &&
lt9611_modes[i].vdisplay == mode->vdisplay &&
lt9611_modes[i].vrefresh == drm_mode_vrefresh(mode)) {
return &lt9611_modes[i];
}
}
return NULL;
}
static enum drm_connector_status lt9611_bridge_detect(struct drm_bridge *bridge)
{
struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
......@@ -833,12 +800,20 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge,
const struct drm_display_info *info,
const struct drm_display_mode *mode)
{
struct lt9611_mode *lt9611_mode = lt9611_find_mode(mode);
struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
if (!lt9611_mode)
return MODE_BAD;
else if (lt9611_mode->intfs > 1 && !lt9611->dsi1)
if (mode->hdisplay > 3840)
return MODE_BAD_HVALUE;
if (mode->vdisplay > 2160)
return MODE_BAD_VVALUE;
if (mode->hdisplay == 3840 &&
mode->vdisplay == 2160 &&
drm_mode_vrefresh(mode) > 30)
return MODE_CLOCK_HIGH;
if (mode->hdisplay > 2000 && !lt9611->dsi1_node)
return MODE_PANEL;
else
return MODE_OK;
......
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