From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 10/10] drm/i915: Stop loading linear degammma LUT on glk needlessly
Date: Thu, 29 Sep 2022 10:15:21 +0300 [thread overview]
Message-ID: <20220929071521.26612-11-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20220929071521.26612-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Make glk_load_luts() a bit lighter for the common case
where neither the degamma LUT nor pipe CSC are enabled
by not loading the linear degamma LUT. Making .load_luts()
as lightweight as possible is a good idea since it may need
to execute from a vblank worker under tight deadlines.
My earlier reasoning for always loading the linear degamma LUT
was to avoid an extra LUT load when just enabling/disabling the
pipe CSC, but that is nonsense since we load the LUTs on every
flagged color manaement change/modeset anyway (either of which
is needed for a pipe CSC toggle).
We can also get rid of the glk_can_preload_luts() special
case since the presence of the degamma LUT will now always
match csc_enable.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_color.c | 26 +++-------------------
1 file changed, 3 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index de530bf1aba1..a3066d942f58 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -1198,24 +1198,6 @@ static bool chv_can_preload_luts(const struct intel_crtc_state *new_crtc_state)
return !old_crtc_state->post_csc_lut;
}
-static bool glk_can_preload_luts(const struct intel_crtc_state *new_crtc_state)
-{
- struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
- struct intel_atomic_state *state =
- to_intel_atomic_state(new_crtc_state->uapi.state);
- const struct intel_crtc_state *old_crtc_state =
- intel_atomic_get_old_crtc_state(state, crtc);
-
- /*
- * The hardware degamma is active whenever the pipe
- * CSC is active. Thus even if the old state has no
- * software degamma we need to avoid clobbering the
- * linear hardware degamma mid scanout.
- */
- return !old_crtc_state->csc_enable &&
- !old_crtc_state->post_csc_lut;
-}
-
int intel_color_check(struct intel_crtc_state *crtc_state)
{
struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
@@ -1622,11 +1604,9 @@ static void glk_assign_luts(struct intel_crtc_state *crtc_state)
* On GLK+ both pipe CSC and degamma LUT are controlled
* by csc_enable. Hence for the cases where the CSC is
* needed but degamma LUT is not we need to load a
- * linear degamma LUT. In fact we'll just always load
- * the degama LUT so that we don't have to reload
- * it every time the pipe CSC is being enabled.
+ * linear degamma LUT.
*/
- if (!crtc_state->pre_csc_lut)
+ if (crtc_state->csc_enable && !crtc_state->pre_csc_lut)
drm_property_replace_blob(&crtc_state->pre_csc_lut,
i915->display.color.glk_linear_degamma_lut);
}
@@ -1667,7 +1647,7 @@ static int glk_color_check(struct intel_crtc_state *crtc_state)
glk_assign_luts(crtc_state);
- crtc_state->preload_luts = glk_can_preload_luts(crtc_state);
+ crtc_state->preload_luts = intel_can_preload_luts(crtc_state);
return 0;
}
--
2.35.1
next prev parent reply other threads:[~2022-09-29 7:16 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 7:15 [Intel-gfx] [PATCH 00/10] drm/i915: Prep work for finishing (de)gamma readout Ville Syrjala
2022-09-29 7:15 ` [Intel-gfx] [PATCH 01/10] drm/i915: Remove PLL asserts from .load_luts() Ville Syrjala
2022-09-29 11:54 ` Jani Nikula
2022-09-29 7:15 ` [Intel-gfx] [PATCH 02/10] drm/i915: Split up intel_color_init() Ville Syrjala
2022-09-29 10:41 ` Jani Nikula
2022-09-29 11:55 ` Jani Nikula
2022-09-29 7:15 ` [Intel-gfx] [PATCH 03/10] drm/i915: Simplify the intel_color_init_hooks() if ladder Ville Syrjala
2022-09-29 11:56 ` Jani Nikula
2022-09-29 7:15 ` [Intel-gfx] [PATCH 04/10] drm/i915: Clean up intel_color_init_hooks() Ville Syrjala
2022-09-29 11:57 ` Jani Nikula
2022-09-29 7:15 ` [Intel-gfx] [PATCH 05/10] drm/i915: Change glk_load_degamma_lut() calling convention Ville Syrjala
2022-09-29 11:58 ` Jani Nikula
2022-09-29 7:15 ` [Intel-gfx] [PATCH 06/10] drm/i915: Make ilk_load_luts() deal with degamma Ville Syrjala
2022-09-29 7:15 ` [Intel-gfx] [PATCH 07/10] drm/i915: Introduce crtc_state->{pre, post}_csc_lut Ville Syrjala
2022-10-19 7:06 ` Shankar, Uma
2022-09-29 7:15 ` [Intel-gfx] [PATCH 08/10] drm/i915: Assert {pre, post}_csc_lut were assigned sensibly Ville Syrjala
2022-10-19 7:09 ` Shankar, Uma
2022-09-29 7:15 ` [Intel-gfx] [PATCH 09/10] drm/i915: Get rid of glk_load_degamma_lut_linear() Ville Syrjala
2022-10-19 7:20 ` Shankar, Uma
2022-10-19 7:29 ` Ville Syrjälä
2022-10-19 7:49 ` Shankar, Uma
2022-09-29 7:15 ` Ville Syrjala [this message]
2022-10-19 7:24 ` [Intel-gfx] [PATCH 10/10] drm/i915: Stop loading linear degammma LUT on glk needlessly Shankar, Uma
2022-09-29 9:19 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Prep work for finishing (de)gamma readout Patchwork
2022-09-29 9:40 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-30 6:35 ` [Intel-gfx] ✓ 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=20220929071521.26612-11-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