From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH 8/9] drm/i915/cursor: Extract intel_cursor_mode_config_init()
Date: Fri, 7 Nov 2025 20:11:25 +0200 [thread overview]
Message-ID: <20251107181126.5743-9-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20251107181126.5743-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Move the max cursor size initialization into intel_cursor.c
so that all the platform specific details about cursors are
concentrated in one file.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_cursor.c | 17 +++++++++++++++++
drivers/gpu/drm/i915/display/intel_cursor.h | 2 ++
.../gpu/drm/i915/display/intel_display_driver.c | 13 ++-----------
3 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c
index 0367e6fc8de7..8410646a1f95 100644
--- a/drivers/gpu/drm/i915/display/intel_cursor.c
+++ b/drivers/gpu/drm/i915/display/intel_cursor.c
@@ -1092,3 +1092,20 @@ intel_cursor_plane_create(struct intel_display *display,
return ERR_PTR(ret);
}
+
+void intel_cursor_mode_config_init(struct intel_display *display)
+{
+ struct drm_mode_config *mode_config = &display->drm->mode_config;
+
+ if (display->platform.i845g || display->platform.i865g) {
+ mode_config->cursor_width = display->platform.i845g ? 64 : 512;
+ mode_config->cursor_height = 1023;
+ } else if (display->platform.i830 || display->platform.i85x ||
+ display->platform.i915g || display->platform.i915gm) {
+ mode_config->cursor_width = 64;
+ mode_config->cursor_height = 64;
+ } else {
+ mode_config->cursor_width = 256;
+ mode_config->cursor_height = 256;
+ }
+}
diff --git a/drivers/gpu/drm/i915/display/intel_cursor.h b/drivers/gpu/drm/i915/display/intel_cursor.h
index 65a9e7eb88c2..7c269d7381ad 100644
--- a/drivers/gpu/drm/i915/display/intel_cursor.h
+++ b/drivers/gpu/drm/i915/display/intel_cursor.h
@@ -17,4 +17,6 @@ intel_cursor_plane_create(struct intel_display *display,
void intel_cursor_unpin_work(struct kthread_work *base);
+void intel_cursor_mode_config_init(struct intel_display *display);
+
#endif
diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
index 63942ebf46fb..7e000ba3e08b 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.c
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
@@ -29,6 +29,7 @@
#include "intel_cdclk.h"
#include "intel_color.h"
#include "intel_crtc.h"
+#include "intel_cursor.h"
#include "intel_dbuf_bw.h"
#include "intel_display_core.h"
#include "intel_display_debugfs.h"
@@ -148,17 +149,7 @@ static void intel_mode_config_init(struct intel_display *display)
mode_config->max_height = 2048;
}
- if (display->platform.i845g || display->platform.i865g) {
- mode_config->cursor_width = display->platform.i845g ? 64 : 512;
- mode_config->cursor_height = 1023;
- } else if (display->platform.i830 || display->platform.i85x ||
- display->platform.i915g || display->platform.i915gm) {
- mode_config->cursor_width = 64;
- mode_config->cursor_height = 64;
- } else {
- mode_config->cursor_width = 256;
- mode_config->cursor_height = 256;
- }
+ intel_cursor_mode_config_init(display);
}
static void intel_mode_config_cleanup(struct intel_display *display)
--
2.49.1
next prev parent reply other threads:[~2025-11-07 18:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 18:11 [PATCH 0/9] drm/i915: Further drm_get_format_info() stuff Ville Syrjala
2025-11-07 18:11 ` [PATCH 1/9] drm/i915: Introduce intel_dumb_fb_max_stride() Ville Syrjala
2025-11-07 18:11 ` [PATCH 2/9] drm/i915: Pass drm_format_info into plane->max_stride() Ville Syrjala
2025-11-07 18:11 ` [PATCH 3/9] drm/i915: Populate fb->format accurately in BIOS FB readout Ville Syrjala
2025-11-07 18:11 ` [PATCH 4/9] drm/i915: Nuke intel_plane_config.tiling Ville Syrjala
2025-11-07 18:11 ` [PATCH 5/9] drm/i915/fb: Init 'ret' in each error branch in intel_framebuffer_init() Ville Syrjala
2025-11-10 11:07 ` Jani Nikula
2025-11-07 18:11 ` [PATCH 6/9] drm/i915/wm: Use drm_get_format_info() in SKL+ cursor DDB allocation Ville Syrjala
2025-11-10 11:08 ` Jani Nikula
2025-11-07 18:11 ` [PATCH 7/9] drm/i915: Use mode_config->cursor_width for " Ville Syrjala
2025-11-10 11:09 ` Jani Nikula
2025-11-07 18:11 ` Ville Syrjala [this message]
2025-11-07 18:11 ` [PATCH 9/9] drm/i915/cursor: Initialize 845 vs 865 cursor size separately Ville Syrjala
2025-11-07 19:24 ` ✓ CI.KUnit: success for drm/i915: Further drm_get_format_info() stuff Patchwork
2025-11-07 19:39 ` ✗ CI.checksparse: warning " Patchwork
2025-11-07 20:34 ` ✓ Xe.CI.BAT: success " Patchwork
2025-11-09 3:40 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-10 11:10 ` [PATCH 0/9] " 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=20251107181126.5743-9-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