From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] drm/i915: avoid full modeset when changing the color range properties Date: Tue, 23 Apr 2013 12:13:34 +0300 Message-ID: <20130423091334.GC4469@intel.com> References: <20130422112449.GA4469@intel.com> <1366643243-27480-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F9E3E5F5A for ; Tue, 23 Apr 2013 02:14:08 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1366643243-27480-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Daniel Vetter Cc: Intel Graphics Development , Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Mon, Apr 22, 2013 at 05:07:23PM +0200, Daniel Vetter wrote: > Automatic color range selection was added in > = > commit 55bc60db5988c8366751d3d04dd690698a53412c > Author: Ville Syrj=E4l=E4 > 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=E4l=E4 > Cc: Paulo Zanoni > Signed-off-by: Daniel Vetter Reviewed-by: Ville Syrj=E4l=E4 > --- > drivers/gpu/drm/i915/intel_dp.c | 8 ++++++++ > drivers/gpu/drm/i915/intel_hdmi.c | 8 ++++++++ > drivers/gpu/drm/i915/intel_sdvo.c | 8 ++++++++ > 3 files changed, 24 insertions(+) > = > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel= _dp.c > index 97edbb2..994a05d 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -2649,6 +2649,9 @@ intel_dp_set_property(struct drm_connector *connect= or, > } > = > if (property =3D=3D dev_priv->broadcast_rgb_property) { > + bool old_auto =3D intel_dp->color_range_auto; > + uint32_t old_range =3D intel_dp->color_range; > + > switch (val) { > case INTEL_BROADCAST_RGB_AUTO: > intel_dp->color_range_auto =3D true; > @@ -2664,6 +2667,11 @@ intel_dp_set_property(struct drm_connector *connec= tor, > default: > return -EINVAL; > } > + > + if (old_auto =3D=3D intel_dp->color_range_auto && > + old_range =3D=3D intel_dp->color_range) > + return 0; > + > goto done; > } > = > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/int= el_hdmi.c > index 3942041..4dca486 100644 > --- a/drivers/gpu/drm/i915/intel_hdmi.c > +++ b/drivers/gpu/drm/i915/intel_hdmi.c > @@ -947,6 +947,9 @@ intel_hdmi_set_property(struct drm_connector *connect= or, > } > = > if (property =3D=3D dev_priv->broadcast_rgb_property) { > + bool old_auto =3D intel_hdmi->color_range_auto; > + uint32_t old_range =3D intel_hdmi->color_range; > + > switch (val) { > case INTEL_BROADCAST_RGB_AUTO: > intel_hdmi->color_range_auto =3D true; > @@ -962,6 +965,11 @@ intel_hdmi_set_property(struct drm_connector *connec= tor, > default: > return -EINVAL; > } > + > + if (old_auto =3D=3D intel_hdmi->color_range_auto && > + old_range =3D=3D intel_hdmi->color_range) > + return 0; > + > goto done; > } > = > diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/int= el_sdvo.c > index a618a6a..d154284 100644 > --- a/drivers/gpu/drm/i915/intel_sdvo.c > +++ b/drivers/gpu/drm/i915/intel_sdvo.c > @@ -1930,6 +1930,9 @@ intel_sdvo_set_property(struct drm_connector *conne= ctor, > } > = > if (property =3D=3D dev_priv->broadcast_rgb_property) { > + bool old_auto =3D intel_sdvo->color_range_auto; > + uint32_t old_range =3D intel_sdvo->color_range; > + > switch (val) { > case INTEL_BROADCAST_RGB_AUTO: > intel_sdvo->color_range_auto =3D true; > @@ -1947,6 +1950,11 @@ intel_sdvo_set_property(struct drm_connector *conn= ector, > default: > return -EINVAL; > } > + > + if (old_auto =3D=3D intel_sdvo->color_range_auto && > + old_range =3D=3D intel_sdvo->color_range) > + return 0; > + > goto done; > } > = > -- = > 1.7.11.7 -- = Ville Syrj=E4l=E4 Intel OTC