Commit dd0f4470 authored by Jani Nikula's avatar Jani Nikula

drm/edid: convert struct detailed_mode_closure to drm_edid

We'll need to propagate drm_edid everywhere.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/da4c927cd973766568a79ef044254fff20317e7f.1652097712.git.jani.nikula@intel.com
parent 40f71f5b
...@@ -96,7 +96,7 @@ static int oui(u8 first, u8 second, u8 third) ...@@ -96,7 +96,7 @@ static int oui(u8 first, u8 second, u8 third)
struct detailed_mode_closure { struct detailed_mode_closure {
struct drm_connector *connector; struct drm_connector *connector;
const struct edid *edid; const struct drm_edid *drm_edid;
bool preferred; bool preferred;
u32 quirks; u32 quirks;
int modes; int modes;
...@@ -3226,25 +3226,25 @@ do_inferred_modes(const struct detailed_timing *timing, void *c) ...@@ -3226,25 +3226,25 @@ do_inferred_modes(const struct detailed_timing *timing, void *c)
return; return;
closure->modes += drm_dmt_modes_for_range(closure->connector, closure->modes += drm_dmt_modes_for_range(closure->connector,
closure->edid, closure->drm_edid->edid,
timing); timing);
if (!version_greater(closure->edid, 1, 1)) if (!version_greater(closure->drm_edid->edid, 1, 1))
return; /* GTF not defined yet */ return; /* GTF not defined yet */
switch (range->flags) { switch (range->flags) {
case 0x02: /* secondary gtf, XXX could do more */ case 0x02: /* secondary gtf, XXX could do more */
case 0x00: /* default gtf */ case 0x00: /* default gtf */
closure->modes += drm_gtf_modes_for_range(closure->connector, closure->modes += drm_gtf_modes_for_range(closure->connector,
closure->edid, closure->drm_edid->edid,
timing); timing);
break; break;
case 0x04: /* cvt, only in 1.4+ */ case 0x04: /* cvt, only in 1.4+ */
if (!version_greater(closure->edid, 1, 3)) if (!version_greater(closure->drm_edid->edid, 1, 3))
break; break;
closure->modes += drm_cvt_modes_for_range(closure->connector, closure->modes += drm_cvt_modes_for_range(closure->connector,
closure->edid, closure->drm_edid->edid,
timing); timing);
break; break;
case 0x01: /* just the ranges, no formula */ case 0x01: /* just the ranges, no formula */
...@@ -3258,7 +3258,7 @@ static int add_inferred_modes(struct drm_connector *connector, ...@@ -3258,7 +3258,7 @@ static int add_inferred_modes(struct drm_connector *connector,
{ {
struct detailed_mode_closure closure = { struct detailed_mode_closure closure = {
.connector = connector, .connector = connector,
.edid = drm_edid->edid, .drm_edid = drm_edid,
}; };
if (version_greater(drm_edid->edid, 1, 0)) if (version_greater(drm_edid->edid, 1, 0))
...@@ -3323,7 +3323,7 @@ static int add_established_modes(struct drm_connector *connector, ...@@ -3323,7 +3323,7 @@ static int add_established_modes(struct drm_connector *connector,
int i, modes = 0; int i, modes = 0;
struct detailed_mode_closure closure = { struct detailed_mode_closure closure = {
.connector = connector, .connector = connector,
.edid = edid, .drm_edid = drm_edid,
}; };
for (i = 0; i <= EDID_EST_TIMINGS; i++) { for (i = 0; i <= EDID_EST_TIMINGS; i++) {
...@@ -3351,7 +3351,6 @@ do_standard_modes(const struct detailed_timing *timing, void *c) ...@@ -3351,7 +3351,6 @@ do_standard_modes(const struct detailed_timing *timing, void *c)
struct detailed_mode_closure *closure = c; struct detailed_mode_closure *closure = c;
const struct detailed_non_pixel *data = &timing->data.other_data; const struct detailed_non_pixel *data = &timing->data.other_data;
struct drm_connector *connector = closure->connector; struct drm_connector *connector = closure->connector;
const struct edid *edid = closure->edid;
int i; int i;
if (!is_display_descriptor(timing, EDID_DETAIL_STD_MODES)) if (!is_display_descriptor(timing, EDID_DETAIL_STD_MODES))
...@@ -3361,7 +3360,7 @@ do_standard_modes(const struct detailed_timing *timing, void *c) ...@@ -3361,7 +3360,7 @@ do_standard_modes(const struct detailed_timing *timing, void *c)
const struct std_timing *std = &data->data.timings[i]; const struct std_timing *std = &data->data.timings[i];
struct drm_display_mode *newmode; struct drm_display_mode *newmode;
newmode = drm_mode_std(connector, edid, std); newmode = drm_mode_std(connector, closure->drm_edid->edid, std);
if (newmode) { if (newmode) {
drm_mode_probed_add(connector, newmode); drm_mode_probed_add(connector, newmode);
closure->modes++; closure->modes++;
...@@ -3380,7 +3379,7 @@ static int add_standard_modes(struct drm_connector *connector, ...@@ -3380,7 +3379,7 @@ static int add_standard_modes(struct drm_connector *connector,
int i, modes = 0; int i, modes = 0;
struct detailed_mode_closure closure = { struct detailed_mode_closure closure = {
.connector = connector, .connector = connector,
.edid = drm_edid->edid, .drm_edid = drm_edid,
}; };
for (i = 0; i < EDID_STD_TIMINGS; i++) { for (i = 0; i < EDID_STD_TIMINGS; i++) {
...@@ -3471,7 +3470,7 @@ add_cvt_modes(struct drm_connector *connector, const struct drm_edid *drm_edid) ...@@ -3471,7 +3470,7 @@ add_cvt_modes(struct drm_connector *connector, const struct drm_edid *drm_edid)
{ {
struct detailed_mode_closure closure = { struct detailed_mode_closure closure = {
.connector = connector, .connector = connector,
.edid = drm_edid->edid, .drm_edid = drm_edid,
}; };
if (version_greater(drm_edid->edid, 1, 2)) if (version_greater(drm_edid->edid, 1, 2))
...@@ -3494,7 +3493,7 @@ do_detailed_mode(const struct detailed_timing *timing, void *c) ...@@ -3494,7 +3493,7 @@ do_detailed_mode(const struct detailed_timing *timing, void *c)
return; return;
newmode = drm_mode_detailed(closure->connector->dev, newmode = drm_mode_detailed(closure->connector->dev,
closure->edid, timing, closure->drm_edid->edid, timing,
closure->quirks); closure->quirks);
if (!newmode) if (!newmode)
return; return;
...@@ -3525,7 +3524,7 @@ static int add_detailed_modes(struct drm_connector *connector, ...@@ -3525,7 +3524,7 @@ static int add_detailed_modes(struct drm_connector *connector,
{ {
struct detailed_mode_closure closure = { struct detailed_mode_closure closure = {
.connector = connector, .connector = connector,
.edid = drm_edid->edid, .drm_edid = drm_edid,
.preferred = true, .preferred = true,
.quirks = quirks, .quirks = quirks,
}; };
......
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