From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH 6/6] drm/i915/panic: Clean up the variables
Date: Wed, 19 Nov 2025 20:16:06 +0200 [thread overview]
Message-ID: <20251119181606.17129-7-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20251119181606.17129-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Use the standard variable names for things, and get rid of any
annoying alasing variables. And sprinkle the consts in while at
it.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_plane.c | 55 ++++++++++------------
drivers/gpu/drm/i915/display/intel_psr.c | 4 +-
drivers/gpu/drm/i915/display/intel_psr.h | 3 +-
3 files changed, 29 insertions(+), 33 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_plane.c b/drivers/gpu/drm/i915/display/intel_plane.c
index 6a3d4ddc52a1..d1df4f1c0bc1 100644
--- a/drivers/gpu/drm/i915/display/intel_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_plane.c
@@ -1274,34 +1274,33 @@ static unsigned int intel_4tile_get_offset(unsigned int width, unsigned int x, u
return offset;
}
-static void intel_panic_flush(struct drm_plane *plane)
+static void intel_panic_flush(struct drm_plane *_plane)
{
- struct intel_plane_state *plane_state = to_intel_plane_state(plane->state);
+ struct intel_plane *plane = to_intel_plane(_plane);
+ struct intel_display *display = to_intel_display(plane);
+ const struct intel_plane_state *plane_state = to_intel_plane_state(plane->base.state);
struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc);
- struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state);
- struct intel_plane *iplane = to_intel_plane(plane);
- struct intel_display *display = to_intel_display(iplane);
- struct drm_framebuffer *fb = plane_state->hw.fb;
- struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
+ const struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state);
+ const struct intel_framebuffer *fb = to_intel_framebuffer(plane_state->hw.fb);
- intel_panic_finish(intel_fb->panic);
+ intel_panic_finish(fb->panic);
if (crtc_state->enable_psr2_sel_fetch) {
/* Force a full update for psr2 */
- intel_psr2_panic_force_full_update(display, crtc_state);
+ intel_psr2_panic_force_full_update(crtc_state);
}
/* Flush the cache and don't disable tiling if it's the fbdev framebuffer.*/
- if (intel_fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) {
+ if (fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) {
struct iosys_map map;
intel_fbdev_get_map(display->fbdev.fbdev, &map);
- drm_clflush_virt_range(map.vaddr, fb->pitches[0] * fb->height);
+ drm_clflush_virt_range(map.vaddr, fb->base.pitches[0] * fb->base.height);
return;
}
- if (fb->modifier && iplane->disable_tiling)
- iplane->disable_tiling(iplane);
+ if (fb->base.modifier != DRM_FORMAT_MOD_LINEAR && plane->disable_tiling)
+ plane->disable_tiling(plane);
}
static unsigned int (*intel_get_tiling_func(u64 fb_modifier))(unsigned int width,
@@ -1339,45 +1338,43 @@ static int intel_get_scanout_buffer(struct drm_plane *plane,
{
struct intel_plane_state *plane_state;
struct drm_gem_object *obj;
- struct drm_framebuffer *fb;
- struct intel_framebuffer *intel_fb;
+ struct intel_framebuffer *fb;
struct intel_display *display = to_intel_display(plane->dev);
if (!plane->state || !plane->state->fb || !plane->state->visible)
return -ENODEV;
plane_state = to_intel_plane_state(plane->state);
- fb = plane_state->hw.fb;
- intel_fb = to_intel_framebuffer(fb);
+ fb = to_intel_framebuffer(plane_state->hw.fb);
- obj = intel_fb_bo(fb);
+ obj = intel_fb_bo(&fb->base);
if (!obj)
return -ENODEV;
- if (intel_fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) {
+ if (fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) {
intel_fbdev_get_map(display->fbdev.fbdev, &sb->map[0]);
} else {
int ret;
/* Can't disable tiling if DPT is in use */
- if (intel_fb_uses_dpt(fb)) {
- if (fb->format->cpp[0] != 4)
+ if (intel_fb_uses_dpt(&fb->base)) {
+ if (fb->base.format->cpp[0] != 4)
return -EOPNOTSUPP;
- intel_fb->panic_tiling = intel_get_tiling_func(fb->modifier);
- if (!intel_fb->panic_tiling)
+ fb->panic_tiling = intel_get_tiling_func(fb->base.modifier);
+ if (!fb->panic_tiling)
return -EOPNOTSUPP;
}
- sb->private = intel_fb;
- ret = intel_panic_setup(intel_fb->panic, sb);
+ sb->private = fb;
+ ret = intel_panic_setup(fb->panic, sb);
if (ret)
return ret;
}
- sb->width = fb->width;
- sb->height = fb->height;
+ sb->width = fb->base.width;
+ sb->height = fb->base.height;
/* Use the generic linear format, because tiling, RC, CCS, CC
* will be disabled in disable_tiling()
*/
- sb->format = drm_format_info(fb->format->format);
- sb->pitch[0] = fb->pitches[0];
+ sb->format = drm_format_info(fb->base.format->format);
+ sb->pitch[0] = fb->base.pitches[0];
return 0;
}
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 65d58d485ed3..61ce23b50bce 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -2998,9 +2998,9 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
return 0;
}
-void intel_psr2_panic_force_full_update(struct intel_display *display,
- struct intel_crtc_state *crtc_state)
+void intel_psr2_panic_force_full_update(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);
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
u32 val = man_trk_ctl_enable_bit_get(display);
diff --git a/drivers/gpu/drm/i915/display/intel_psr.h b/drivers/gpu/drm/i915/display/intel_psr.h
index 620b35928832..024ee4c30985 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.h
+++ b/drivers/gpu/drm/i915/display/intel_psr.h
@@ -59,8 +59,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
struct intel_crtc *crtc);
void intel_psr2_program_trans_man_trk_ctl(struct intel_dsb *dsb,
const struct intel_crtc_state *crtc_state);
-void intel_psr2_panic_force_full_update(struct intel_display *display,
- struct intel_crtc_state *crtc_state);
+void intel_psr2_panic_force_full_update(const struct intel_crtc_state *crtc_state);
void intel_psr_pause(struct intel_dp *intel_dp);
void intel_psr_resume(struct intel_dp *intel_dp);
bool intel_psr_needs_vblank_notification(const struct intel_crtc_state *crtc_state);
--
2.49.1
next prev parent reply other threads:[~2025-11-19 18:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-19 18:16 [PATCH 0/6] drm/i915: uapi vs. hw state fixes Ville Syrjala
2025-11-19 18:16 ` [PATCH 1/6] drm/i915: Use the proper (hw.crtc) for the cursor unpin vblank worker Ville Syrjala
2025-11-19 18:16 ` [PATCH 2/6] drm/i915/psr: Use hw.crtc instead of uapi.crtc Ville Syrjala
2025-11-19 18:16 ` [PATCH 3/6] drm/i915/psr: Use hw.rotation instead of uapi.rotation Ville Syrjala
2025-11-19 18:16 ` [PATCH 4/6] drm/i915: Use hw.active instead of uapi.active in the initial plane readout Ville Syrjala
2025-11-19 18:16 ` [PATCH 5/6] drm/i915/panic: Get the crtc from the correct place Ville Syrjala
2025-11-19 18:16 ` Ville Syrjala [this message]
2025-11-19 18:30 ` ✓ CI.KUnit: success for drm/i915: uapi vs. hw state fixes Patchwork
2025-11-19 19:30 ` ✓ Xe.CI.BAT: " Patchwork
2025-11-19 23:04 ` ✓ Xe.CI.Full: " Patchwork
2025-11-25 19:41 ` [PATCH 0/6] " Jani Nikula
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=20251119181606.17129-7-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.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