From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v3 5/7] drm/i915: Turn off pipe CSC when it's not needed
Date: Thu, 7 Feb 2019 22:21:44 +0200 [thread overview]
Message-ID: <20190207202146.26423-6-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190207202146.26423-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
As with pipe gamma we can avoid the potential precision loss from
the pipe csc unit when there is no need to use it. And again
we need the same logic for updating the planes.
v2: Rebase
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
---
drivers/gpu/drm/i915/intel_color.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
index c7030f682812..9720af3742f7 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -663,7 +663,8 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
intel_atomic_get_old_crtc_state(state, crtc);
struct intel_plane *plane;
- if (new_crtc_state->gamma_enable == old_crtc_state->gamma_enable)
+ if (new_crtc_state->gamma_enable == old_crtc_state->gamma_enable &&
+ new_crtc_state->csc_enable == old_crtc_state->csc_enable)
return 0;
for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
@@ -704,6 +705,7 @@ int intel_color_check(struct intel_crtc_state *crtc_state)
struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
const struct drm_property_blob *gamma_lut = crtc_state->base.gamma_lut;
const struct drm_property_blob *degamma_lut = crtc_state->base.degamma_lut;
+ bool limited_color_range = false;
int gamma_length, degamma_length;
u32 gamma_tests, degamma_tests;
int ret;
@@ -717,7 +719,11 @@ int intel_color_check(struct intel_crtc_state *crtc_state)
if (INTEL_GEN(dev_priv) >= 9 ||
IS_BROADWELL(dev_priv) || IS_HASWELL(dev_priv))
- crtc_state->csc_enable = true;
+ limited_color_range = crtc_state->limited_color_range;
+
+ crtc_state->csc_enable =
+ crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB ||
+ crtc_state->base.ctm || limited_color_range;
ret = intel_color_add_affected_planes(crtc_state);
if (ret)
--
2.19.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-02-07 20:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 20:21 [PATCH v3 0/7] Enable/disable gamma/csc dynamically and fix C8 Ville Syrjala
2019-02-07 20:21 ` [PATCH v3 1/7] drm/i915: Populate gamma_mode for all platforms Ville Syrjala
2019-02-07 20:21 ` [PATCH v3 2/7] drm/i915: Track pipe gamma enable/disable in crtc state Ville Syrjala
2019-02-07 20:39 ` [PATCH v4 " Ville Syrjala
2019-02-07 20:21 ` [PATCH v3 3/7] drm/i915: Track pipe csc enable " Ville Syrjala
2019-02-07 20:21 ` [PATCH v3 4/7] drm/i915: Turn off pipe gamma when it's not needed Ville Syrjala
2019-02-07 20:21 ` Ville Syrjala [this message]
2019-02-07 20:21 ` [PATCH v3 6/7] drm/i915: Disable pipe gamma when C8 pixel format is used Ville Syrjala
2019-02-07 20:21 ` [PATCH v3 7/7] drm/i915: Update DSPCNTR gamma/csc bits during crtc_enable() Ville Syrjala
2019-02-07 20:56 ` ✗ Fi.CI.BAT: failure for Enable/disable gamma/csc dynamically and fix C8 Patchwork
2019-02-07 21:11 ` Ville Syrjälä
2019-02-07 22:11 ` ✓ Fi.CI.BAT: success for Enable/disable gamma/csc dynamically and fix C8 (rev2) Patchwork
2019-02-08 0:46 ` ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190207202146.26423-6-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox