aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_fbdev.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2024-06-12 23:47:07 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2024-06-24 17:12:10 +0300
commitc7bfd98f00f954e40356cbd80db2dc1992230e94 (patch)
tree1027da6c4947ecaf3727fc36fa734d6dca6c8c5d /drivers/gpu/drm/i915/display/intel_fbdev.c
parent195b7a0d2ebe5672a58210992f3629d19d5a95ae (diff)
drm/i915: Introduce fb->min_alignment
Different planes could have different alignment requirements even for the same format/modifier. Collect the alignment requirements across all planes capable of scanning out the fb such that the alignment is satisfactory to all those planes. So far this was sort of handled by making sure intel_surf_alignment() declares the superset of all planes' alignment requirements, but maintaining that manually is annoying. So we're going to move towards each plane declaring only its own requirements, and thus we need code to generate the superset. v2: Drop the borked per-plane vma optimization (Imre) Assert that the plane's declared alignment is POT (Imre) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240612204712.31404-5-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak <imre.deak@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_fbdev.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_fbdev.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 6e5f88f20482..49a1ac4f5491 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -47,7 +47,6 @@
#include "gem/i915_gem_object.h"
#include "i915_drv.h"
-#include "intel_crtc.h"
#include "intel_display_types.h"
#include "intel_fb.h"
#include "intel_fb_pin.h"
@@ -173,21 +172,6 @@ static const struct fb_ops intelfb_ops = {
__diag_pop();
-static unsigned int intel_fbdev_min_alignment(const struct drm_framebuffer *fb)
-{
- struct drm_i915_private *i915 = to_i915(fb->dev);
- struct intel_plane *plane;
- struct intel_crtc *crtc;
-
- crtc = intel_first_crtc(i915);
- if (!crtc)
- return 0;
-
- plane = to_intel_plane(crtc->base.primary);
-
- return plane->min_alignment(plane, fb, 0);
-}
-
static int intelfb_create(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
{
@@ -245,7 +229,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
* BIOS is suitable for own access.
*/
vma = intel_fb_pin_to_ggtt(&fb->base, &view,
- intel_fbdev_min_alignment(&fb->base), 0,
+ fb->min_alignment, 0,
false, &flags);
if (IS_ERR(vma)) {
ret = PTR_ERR(vma);