From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH 03/14] drm/i915/ips: convert hsw_ips.c to struct intel_display
Date: Wed, 12 Feb 2025 18:36:32 +0200 [thread overview]
Message-ID: <ebea40784fca6cfb4dbacec570bc9bef49393fc1.1739378095.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1739378095.git.jani.nikula@intel.com>
Going forward, struct intel_display is the main display device data
pointer. Convert as much as possible of hsw_ips.c to struct
intel_display.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/hsw_ips.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/hsw_ips.c b/drivers/gpu/drm/i915/display/hsw_ips.c
index d02c328bf902..674a0e5f0858 100644
--- a/drivers/gpu/drm/i915/display/hsw_ips.c
+++ b/drivers/gpu/drm/i915/display/hsw_ips.c
@@ -36,7 +36,7 @@ static void hsw_ips_enable(const struct intel_crtc_state *crtc_state)
if (display->ips.false_color)
val |= IPS_FALSE_COLOR;
- if (IS_BROADWELL(i915)) {
+ if (display->platform.broadwell) {
drm_WARN_ON(display->drm,
snb_pcode_write(&i915->uncore, DISPLAY_IPS_CONTROL,
val | IPS_PCODE_CONTROL));
@@ -71,7 +71,7 @@ bool hsw_ips_disable(const struct intel_crtc_state *crtc_state)
if (!crtc_state->ips_enabled)
return need_vblank_wait;
- if (IS_BROADWELL(i915)) {
+ if (display->platform.broadwell) {
drm_WARN_ON(display->drm,
snb_pcode_write(&i915->uncore, DISPLAY_IPS_CONTROL, 0));
/*
@@ -96,7 +96,7 @@ bool hsw_ips_disable(const struct intel_crtc_state *crtc_state)
static bool hsw_ips_need_disable(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{
- struct drm_i915_private *i915 = to_i915(state->base.dev);
+ struct intel_display *display = to_intel_display(state);
const struct intel_crtc_state *old_crtc_state =
intel_atomic_get_old_crtc_state(state, crtc);
const struct intel_crtc_state *new_crtc_state =
@@ -114,7 +114,7 @@ static bool hsw_ips_need_disable(struct intel_atomic_state *state,
*
* Disable IPS before we program the LUT.
*/
- if (IS_HASWELL(i915) &&
+ if (display->platform.haswell &&
intel_crtc_needs_color_update(new_crtc_state) &&
new_crtc_state->gamma_mode == GAMMA_MODE_MODE_SPLIT)
return true;
@@ -137,7 +137,7 @@ bool hsw_ips_pre_update(struct intel_atomic_state *state,
static bool hsw_ips_need_enable(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{
- struct drm_i915_private *i915 = to_i915(state->base.dev);
+ struct intel_display *display = to_intel_display(state);
const struct intel_crtc_state *old_crtc_state =
intel_atomic_get_old_crtc_state(state, crtc);
const struct intel_crtc_state *new_crtc_state =
@@ -155,7 +155,7 @@ static bool hsw_ips_need_enable(struct intel_atomic_state *state,
*
* Re-enable IPS after the LUT has been programmed.
*/
- if (IS_HASWELL(i915) &&
+ if (display->platform.haswell &&
intel_crtc_needs_color_update(new_crtc_state) &&
new_crtc_state->gamma_mode == GAMMA_MODE_MODE_SPLIT)
return true;
@@ -194,7 +194,6 @@ static bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state
{
struct intel_display *display = to_intel_display(crtc_state);
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
- struct drm_i915_private *i915 = to_i915(crtc->base.dev);
/* IPS only exists on ULT machines and is tied to pipe A. */
if (!hsw_crtc_supports_ips(crtc))
@@ -213,7 +212,7 @@ static bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state
*
* Should measure whether using a lower cdclk w/o IPS
*/
- if (IS_BROADWELL(i915) &&
+ if (display->platform.broadwell &&
crtc_state->pixel_rate > display->cdclk.max_cdclk_freq * 95 / 100)
return false;
@@ -222,9 +221,9 @@ static bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state
int hsw_ips_min_cdclk(const struct intel_crtc_state *crtc_state)
{
- struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
+ struct intel_display *display = to_intel_display(crtc_state);
- if (!IS_BROADWELL(i915))
+ if (!display->platform.broadwell)
return 0;
if (!hsw_crtc_state_ips_capable(crtc_state))
@@ -237,7 +236,7 @@ int hsw_ips_min_cdclk(const struct intel_crtc_state *crtc_state)
int hsw_ips_compute_config(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{
- struct drm_i915_private *i915 = to_i915(state->base.dev);
+ struct intel_display *display = to_intel_display(state);
struct intel_crtc_state *crtc_state =
intel_atomic_get_new_crtc_state(state, crtc);
@@ -259,7 +258,7 @@ int hsw_ips_compute_config(struct intel_atomic_state *state,
if (!(crtc_state->active_planes & ~BIT(PLANE_CURSOR)))
return 0;
- if (IS_BROADWELL(i915)) {
+ if (display->platform.broadwell) {
const struct intel_cdclk_state *cdclk_state;
cdclk_state = intel_atomic_get_cdclk_state(state);
@@ -280,12 +279,11 @@ void hsw_ips_get_config(struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(crtc_state);
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
- struct drm_i915_private *i915 = to_i915(crtc->base.dev);
if (!hsw_crtc_supports_ips(crtc))
return;
- if (IS_HASWELL(i915)) {
+ if (display->platform.haswell) {
crtc_state->ips_enabled = intel_de_read(display, IPS_CTL) & IPS_ENABLE;
} else {
/*
--
2.39.5
next prev parent reply other threads:[~2025-02-12 16:37 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 16:36 [PATCH 00/14] drm/i915/display: conversions to struct intel_display Jani Nikula
2025-02-12 16:36 ` [PATCH 01/14] drm/i915/dp: convert g4x_dp.[ch] to struct intel display Jani Nikula
2025-02-13 8:48 ` Kandpal, Suraj
2025-02-13 9:13 ` Jani Nikula
2025-02-13 9:19 ` Kandpal, Suraj
2025-02-12 16:36 ` [PATCH 02/14] drm/i915/hdmi: convert g4x_hdmi.[ch] to struct intel_display Jani Nikula
2025-02-13 8:55 ` Kandpal, Suraj
2025-02-13 9:15 ` Jani Nikula
2025-02-12 16:36 ` Jani Nikula [this message]
2025-02-13 8:56 ` [PATCH 03/14] drm/i915/ips: convert hsw_ips.c " Kandpal, Suraj
2025-02-12 16:36 ` [PATCH 04/14] drm/i915/display: convert assert_transcoder*() " Jani Nikula
2025-02-13 8:58 ` Kandpal, Suraj
2025-02-12 16:36 ` [PATCH 05/14] drm/i915/display: convert assert_port_valid() " Jani Nikula
2025-02-13 8:59 ` Kandpal, Suraj
2025-02-12 16:36 ` [PATCH 06/14] drm/i915/hpd: drop dev_priv parameter from intel_hpd_pin_default() Jani Nikula
2025-02-13 9:01 ` Kandpal, Suraj
2025-02-12 16:36 ` [PATCH 07/14] drm/i915/display: convert intel_set_{cpu, pch}_fifo_underrun_reporting() to intel_display Jani Nikula
2025-02-13 9:03 ` Kandpal, Suraj
2025-02-12 16:36 ` [PATCH 08/14] drm/i915/sdvo: convert intel_sdvo.[ch] to struct intel_display Jani Nikula
2025-02-13 9:13 ` Kandpal, Suraj
2025-02-13 11:16 ` Jani Nikula
2025-02-12 16:36 ` [PATCH 09/14] drm/i915/display: convert intel_cpu_transcoder_mode_valid() to intel_display Jani Nikula
2025-02-13 9:15 ` Kandpal, Suraj
2025-02-12 16:36 ` [PATCH 10/14] drm/i915/display: convert intel_mode_valid_max_plane_size() " Jani Nikula
2025-02-13 9:16 ` Kandpal, Suraj
2025-02-12 16:36 ` [PATCH 11/14] drm/i915/dsi: convert platform checks to display->platform.<platform> style Jani Nikula
2025-02-12 16:36 ` [PATCH 12/14] drm/i915/combo-phy: convert intel_combo_phy.[ch] to struct intel_display Jani Nikula
2025-02-12 16:36 ` [PATCH 13/14] drm/i915/display: convert intel_fifo_underrun.[ch] " Jani Nikula
2025-02-12 16:36 ` [PATCH 14/14] drm/i915/display: convert i915_pipestat_enable_mask() " Jani Nikula
2025-02-12 17:17 ` [PATCH 00/14] drm/i915/display: conversions " Ville Syrjälä
2025-02-13 8:27 ` Jani Nikula
2025-02-12 20:32 ` ✓ CI.Patch_applied: success for " Patchwork
2025-02-12 20:33 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-12 20:34 ` ✓ CI.KUnit: success " Patchwork
2025-02-12 20:51 ` ✓ CI.Build: " Patchwork
2025-02-12 20:53 ` ✓ CI.Hooks: " Patchwork
2025-02-12 20:55 ` ✗ CI.checksparse: warning " Patchwork
2025-02-12 21:17 ` ✓ Xe.CI.BAT: success " Patchwork
2025-02-13 5:55 ` ✗ Xe.CI.Full: failure " 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=ebea40784fca6cfb4dbacec570bc9bef49393fc1.1739378095.git.jani.nikula@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@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