Skip to content

Commit

Permalink
drm/i915: avoid full modeset when changing the color range properties
Browse files Browse the repository at this point in the history
Automatic color range selection was added in

commit 55bc60d
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Thu Jan 17 16:31:29 2013 +0200

    drm/i915: Add "Automatic" mode for the "Broadcast RGB" property

but that removed the check to avoid a full modeset if the value is
unchanged. Unfortunately X sets all properties with their current
value at start-up, resulting in some ugly flickering which shouldn't
be there.

v2: Change old_range from bool to uint32_t, spotted by Ville.

v3: Actually git add everything ;-)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed Apr 23, 2013
1 parent e4bfff5 commit ae4edb8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/gpu/drm/i915/intel_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2428,6 +2428,9 @@ intel_dp_set_property(struct drm_connector *connector,
}

if (property == dev_priv->broadcast_rgb_property) {
bool old_auto = intel_dp->color_range_auto;
uint32_t old_range = intel_dp->color_range;

switch (val) {
case INTEL_BROADCAST_RGB_AUTO:
intel_dp->color_range_auto = true;
Expand All @@ -2443,6 +2446,11 @@ intel_dp_set_property(struct drm_connector *connector,
default:
return -EINVAL;
}

if (old_auto == intel_dp->color_range_auto &&
old_range == intel_dp->color_range)
return 0;

goto done;
}

Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/i915/intel_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,9 @@ intel_hdmi_set_property(struct drm_connector *connector,
}

if (property == dev_priv->broadcast_rgb_property) {
bool old_auto = intel_hdmi->color_range_auto;
uint32_t old_range = intel_hdmi->color_range;

switch (val) {
case INTEL_BROADCAST_RGB_AUTO:
intel_hdmi->color_range_auto = true;
Expand All @@ -935,6 +938,11 @@ intel_hdmi_set_property(struct drm_connector *connector,
default:
return -EINVAL;
}

if (old_auto == intel_hdmi->color_range_auto &&
old_range == intel_hdmi->color_range)
return 0;

goto done;
}

Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/i915/intel_sdvo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,9 @@ intel_sdvo_set_property(struct drm_connector *connector,
}

if (property == dev_priv->broadcast_rgb_property) {
bool old_auto = intel_sdvo->color_range_auto;
uint32_t old_range = intel_sdvo->color_range;

switch (val) {
case INTEL_BROADCAST_RGB_AUTO:
intel_sdvo->color_range_auto = true;
Expand All @@ -1947,6 +1950,11 @@ intel_sdvo_set_property(struct drm_connector *connector,
default:
return -EINVAL;
}

if (old_auto == intel_sdvo->color_range_auto &&
old_range == intel_sdvo->color_range)
return 0;

goto done;
}

Expand Down

0 comments on commit ae4edb8

Please sign in to comment.