Commit 4959b693 authored by Jani Nikula's avatar Jani Nikula

drm/edid: stop passing quirks around

Now that quirks are stored in display info, we can just look them up
using the connector instead of having to pass them around.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/d55049dd9b2e48e63103f2dfa49bc9b25dd57f82.1672826282.git.jani.nikula@intel.com
parent 783dedc5
...@@ -96,7 +96,6 @@ struct detailed_mode_closure { ...@@ -96,7 +96,6 @@ struct detailed_mode_closure {
struct drm_connector *connector; struct drm_connector *connector;
const struct drm_edid *drm_edid; const struct drm_edid *drm_edid;
bool preferred; bool preferred;
u32 quirks;
int modes; int modes;
}; };
...@@ -2887,9 +2886,9 @@ static u32 edid_get_quirks(const struct drm_edid *drm_edid) ...@@ -2887,9 +2886,9 @@ static u32 edid_get_quirks(const struct drm_edid *drm_edid)
* Walk the mode list for connector, clearing the preferred status on existing * Walk the mode list for connector, clearing the preferred status on existing
* modes and setting it anew for the right mode ala quirks. * modes and setting it anew for the right mode ala quirks.
*/ */
static void edid_fixup_preferred(struct drm_connector *connector, static void edid_fixup_preferred(struct drm_connector *connector)
u32 quirks)
{ {
const struct drm_display_info *info = &connector->display_info;
struct drm_display_mode *t, *cur_mode, *preferred_mode; struct drm_display_mode *t, *cur_mode, *preferred_mode;
int target_refresh = 0; int target_refresh = 0;
int cur_vrefresh, preferred_vrefresh; int cur_vrefresh, preferred_vrefresh;
...@@ -2897,9 +2896,9 @@ static void edid_fixup_preferred(struct drm_connector *connector, ...@@ -2897,9 +2896,9 @@ static void edid_fixup_preferred(struct drm_connector *connector,
if (list_empty(&connector->probed_modes)) if (list_empty(&connector->probed_modes))
return; return;
if (quirks & EDID_QUIRK_PREFER_LARGE_60) if (info->quirks & EDID_QUIRK_PREFER_LARGE_60)
target_refresh = 60; target_refresh = 60;
if (quirks & EDID_QUIRK_PREFER_LARGE_75) if (info->quirks & EDID_QUIRK_PREFER_LARGE_75)
target_refresh = 75; target_refresh = 75;
preferred_mode = list_first_entry(&connector->probed_modes, preferred_mode = list_first_entry(&connector->probed_modes,
...@@ -3401,9 +3400,9 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode, ...@@ -3401,9 +3400,9 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
*/ */
static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connector, static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connector,
const struct drm_edid *drm_edid, const struct drm_edid *drm_edid,
const struct detailed_timing *timing, const struct detailed_timing *timing)
u32 quirks)
{ {
const struct drm_display_info *info = &connector->display_info;
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_display_mode *mode; struct drm_display_mode *mode;
const struct detailed_pixel_timing *pt = &timing->data.pixel_data; const struct detailed_pixel_timing *pt = &timing->data.pixel_data;
...@@ -3437,7 +3436,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto ...@@ -3437,7 +3436,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
return NULL; return NULL;
} }
if (quirks & EDID_QUIRK_FORCE_REDUCED_BLANKING) { if (info->quirks & EDID_QUIRK_FORCE_REDUCED_BLANKING) {
mode = drm_cvt_mode(dev, hactive, vactive, 60, true, false, false); mode = drm_cvt_mode(dev, hactive, vactive, 60, true, false, false);
if (!mode) if (!mode)
return NULL; return NULL;
...@@ -3449,7 +3448,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto ...@@ -3449,7 +3448,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
if (!mode) if (!mode)
return NULL; return NULL;
if (quirks & EDID_QUIRK_135_CLOCK_TOO_HIGH) if (info->quirks & EDID_QUIRK_135_CLOCK_TOO_HIGH)
mode->clock = 1088 * 10; mode->clock = 1088 * 10;
else else
mode->clock = le16_to_cpu(timing->pixel_clock) * 10; mode->clock = le16_to_cpu(timing->pixel_clock) * 10;
...@@ -3472,7 +3471,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto ...@@ -3472,7 +3471,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
drm_mode_do_interlace_quirk(mode, pt); drm_mode_do_interlace_quirk(mode, pt);
if (quirks & EDID_QUIRK_DETAILED_SYNC_PP) { if (info->quirks & EDID_QUIRK_DETAILED_SYNC_PP) {
mode->flags |= DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC; mode->flags |= DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC;
} else { } else {
mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ? mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ?
...@@ -3485,12 +3484,12 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto ...@@ -3485,12 +3484,12 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4; mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4;
mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf) << 8; mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf) << 8;
if (quirks & EDID_QUIRK_DETAILED_IN_CM) { if (info->quirks & EDID_QUIRK_DETAILED_IN_CM) {
mode->width_mm *= 10; mode->width_mm *= 10;
mode->height_mm *= 10; mode->height_mm *= 10;
} }
if (quirks & EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE) { if (info->quirks & EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE) {
mode->width_mm = drm_edid->edid->width_cm * 10; mode->width_mm = drm_edid->edid->width_cm * 10;
mode->height_mm = drm_edid->edid->height_cm * 10; mode->height_mm = drm_edid->edid->height_cm * 10;
} }
...@@ -4003,8 +4002,7 @@ do_detailed_mode(const struct detailed_timing *timing, void *c) ...@@ -4003,8 +4002,7 @@ do_detailed_mode(const struct detailed_timing *timing, void *c)
return; return;
newmode = drm_mode_detailed(closure->connector, newmode = drm_mode_detailed(closure->connector,
closure->drm_edid, timing, closure->drm_edid, timing);
closure->quirks);
if (!newmode) if (!newmode)
return; return;
...@@ -4027,15 +4025,13 @@ do_detailed_mode(const struct detailed_timing *timing, void *c) ...@@ -4027,15 +4025,13 @@ do_detailed_mode(const struct detailed_timing *timing, void *c)
* add_detailed_modes - Add modes from detailed timings * add_detailed_modes - Add modes from detailed timings
* @connector: attached connector * @connector: attached connector
* @drm_edid: EDID block to scan * @drm_edid: EDID block to scan
* @quirks: quirks to apply
*/ */
static int add_detailed_modes(struct drm_connector *connector, static int add_detailed_modes(struct drm_connector *connector,
const struct drm_edid *drm_edid, u32 quirks) const struct drm_edid *drm_edid)
{ {
struct detailed_mode_closure closure = { struct detailed_mode_closure closure = {
.connector = connector, .connector = connector,
.drm_edid = drm_edid, .drm_edid = drm_edid,
.quirks = quirks,
}; };
if (drm_edid->edid->revision >= 4) if (drm_edid->edid->revision >= 4)
...@@ -6651,7 +6647,7 @@ static int _drm_edid_connector_update(struct drm_connector *connector, ...@@ -6651,7 +6647,7 @@ static int _drm_edid_connector_update(struct drm_connector *connector,
* *
* XXX order for additional mode types in extension blocks? * XXX order for additional mode types in extension blocks?
*/ */
num_modes += add_detailed_modes(connector, drm_edid, info->quirks); num_modes += add_detailed_modes(connector, drm_edid);
num_modes += add_cvt_modes(connector, drm_edid); num_modes += add_cvt_modes(connector, drm_edid);
num_modes += add_standard_modes(connector, drm_edid); num_modes += add_standard_modes(connector, drm_edid);
num_modes += add_established_modes(connector, drm_edid); num_modes += add_established_modes(connector, drm_edid);
...@@ -6662,7 +6658,7 @@ static int _drm_edid_connector_update(struct drm_connector *connector, ...@@ -6662,7 +6658,7 @@ static int _drm_edid_connector_update(struct drm_connector *connector,
num_modes += add_inferred_modes(connector, drm_edid); num_modes += add_inferred_modes(connector, drm_edid);
if (info->quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75)) if (info->quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
edid_fixup_preferred(connector, info->quirks); edid_fixup_preferred(connector);
if (info->quirks & EDID_QUIRK_FORCE_6BPC) if (info->quirks & EDID_QUIRK_FORCE_6BPC)
info->bpc = 6; info->bpc = 6;
......
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