Commit 741922e7 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-intel-fixes-2024-02-22' of...

Merge tag 'drm-intel-fixes-2024-02-22' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes

- Fixup for TV mode
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZdcwT9kltvEgJZZE@jlahtine-mobl.ger.corp.intel.com
parents f581dbb3 fb1e8812
...@@ -1209,7 +1209,7 @@ static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo, ...@@ -1209,7 +1209,7 @@ static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_tv_format format; struct intel_sdvo_tv_format format;
u32 format_map; u32 format_map;
format_map = 1 << conn_state->tv.mode; format_map = 1 << conn_state->tv.legacy_mode;
memset(&format, 0, sizeof(format)); memset(&format, 0, sizeof(format));
memcpy(&format, &format_map, min(sizeof(format), sizeof(format_map))); memcpy(&format, &format_map, min(sizeof(format), sizeof(format_map)));
...@@ -2298,7 +2298,7 @@ static int intel_sdvo_get_tv_modes(struct drm_connector *connector) ...@@ -2298,7 +2298,7 @@ static int intel_sdvo_get_tv_modes(struct drm_connector *connector)
* Read the list of supported input resolutions for the selected TV * Read the list of supported input resolutions for the selected TV
* format. * format.
*/ */
format_map = 1 << conn_state->tv.mode; format_map = 1 << conn_state->tv.legacy_mode;
memcpy(&tv_res, &format_map, memcpy(&tv_res, &format_map,
min(sizeof(format_map), sizeof(struct intel_sdvo_sdtv_resolution_request))); min(sizeof(format_map), sizeof(struct intel_sdvo_sdtv_resolution_request)));
...@@ -2363,7 +2363,7 @@ intel_sdvo_connector_atomic_get_property(struct drm_connector *connector, ...@@ -2363,7 +2363,7 @@ intel_sdvo_connector_atomic_get_property(struct drm_connector *connector,
int i; int i;
for (i = 0; i < intel_sdvo_connector->format_supported_num; i++) for (i = 0; i < intel_sdvo_connector->format_supported_num; i++)
if (state->tv.mode == intel_sdvo_connector->tv_format_supported[i]) { if (state->tv.legacy_mode == intel_sdvo_connector->tv_format_supported[i]) {
*val = i; *val = i;
return 0; return 0;
...@@ -2419,7 +2419,7 @@ intel_sdvo_connector_atomic_set_property(struct drm_connector *connector, ...@@ -2419,7 +2419,7 @@ intel_sdvo_connector_atomic_set_property(struct drm_connector *connector,
struct intel_sdvo_connector_state *sdvo_state = to_intel_sdvo_connector_state(state); struct intel_sdvo_connector_state *sdvo_state = to_intel_sdvo_connector_state(state);
if (property == intel_sdvo_connector->tv_format) { if (property == intel_sdvo_connector->tv_format) {
state->tv.mode = intel_sdvo_connector->tv_format_supported[val]; state->tv.legacy_mode = intel_sdvo_connector->tv_format_supported[val];
if (state->crtc) { if (state->crtc) {
struct drm_crtc_state *crtc_state = struct drm_crtc_state *crtc_state =
...@@ -3076,7 +3076,7 @@ static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, ...@@ -3076,7 +3076,7 @@ static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
drm_property_add_enum(intel_sdvo_connector->tv_format, i, drm_property_add_enum(intel_sdvo_connector->tv_format, i,
tv_format_names[intel_sdvo_connector->tv_format_supported[i]]); tv_format_names[intel_sdvo_connector->tv_format_supported[i]]);
intel_sdvo_connector->base.base.state->tv.mode = intel_sdvo_connector->tv_format_supported[0]; intel_sdvo_connector->base.base.state->tv.legacy_mode = intel_sdvo_connector->tv_format_supported[0];
drm_object_attach_property(&intel_sdvo_connector->base.base.base, drm_object_attach_property(&intel_sdvo_connector->base.base.base,
intel_sdvo_connector->tv_format, 0); intel_sdvo_connector->tv_format, 0);
return true; return true;
......
...@@ -949,7 +949,7 @@ intel_disable_tv(struct intel_atomic_state *state, ...@@ -949,7 +949,7 @@ intel_disable_tv(struct intel_atomic_state *state,
static const struct tv_mode *intel_tv_mode_find(const struct drm_connector_state *conn_state) static const struct tv_mode *intel_tv_mode_find(const struct drm_connector_state *conn_state)
{ {
int format = conn_state->tv.mode; int format = conn_state->tv.legacy_mode;
return &tv_modes[format]; return &tv_modes[format];
} }
...@@ -1704,7 +1704,7 @@ static void intel_tv_find_better_format(struct drm_connector *connector) ...@@ -1704,7 +1704,7 @@ static void intel_tv_find_better_format(struct drm_connector *connector)
break; break;
} }
connector->state->tv.mode = i; connector->state->tv.legacy_mode = i;
} }
static int static int
...@@ -1859,7 +1859,7 @@ static int intel_tv_atomic_check(struct drm_connector *connector, ...@@ -1859,7 +1859,7 @@ static int intel_tv_atomic_check(struct drm_connector *connector,
old_state = drm_atomic_get_old_connector_state(state, connector); old_state = drm_atomic_get_old_connector_state(state, connector);
new_crtc_state = drm_atomic_get_new_crtc_state(state, new_state->crtc); new_crtc_state = drm_atomic_get_new_crtc_state(state, new_state->crtc);
if (old_state->tv.mode != new_state->tv.mode || if (old_state->tv.legacy_mode != new_state->tv.legacy_mode ||
old_state->tv.margins.left != new_state->tv.margins.left || old_state->tv.margins.left != new_state->tv.margins.left ||
old_state->tv.margins.right != new_state->tv.margins.right || old_state->tv.margins.right != new_state->tv.margins.right ||
old_state->tv.margins.top != new_state->tv.margins.top || old_state->tv.margins.top != new_state->tv.margins.top ||
...@@ -1896,7 +1896,7 @@ static void intel_tv_add_properties(struct drm_connector *connector) ...@@ -1896,7 +1896,7 @@ static void intel_tv_add_properties(struct drm_connector *connector)
conn_state->tv.margins.right = 46; conn_state->tv.margins.right = 46;
conn_state->tv.margins.bottom = 37; conn_state->tv.margins.bottom = 37;
conn_state->tv.mode = 0; conn_state->tv.legacy_mode = 0;
/* Create TV properties then attach current values */ /* Create TV properties then attach current values */
for (i = 0; i < ARRAY_SIZE(tv_modes); i++) { for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
...@@ -1910,7 +1910,7 @@ static void intel_tv_add_properties(struct drm_connector *connector) ...@@ -1910,7 +1910,7 @@ static void intel_tv_add_properties(struct drm_connector *connector)
drm_object_attach_property(&connector->base, drm_object_attach_property(&connector->base,
i915->drm.mode_config.legacy_tv_mode_property, i915->drm.mode_config.legacy_tv_mode_property,
conn_state->tv.mode); conn_state->tv.legacy_mode);
drm_object_attach_property(&connector->base, drm_object_attach_property(&connector->base,
i915->drm.mode_config.tv_left_margin_property, i915->drm.mode_config.tv_left_margin_property,
conn_state->tv.margins.left); conn_state->tv.margins.left);
......
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