All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/fb: move intel_dumb_fb_max_stride() to intel_fb.[ch]
Date: Wed, 18 Nov 2026 19:01:10 +0200	[thread overview]
Message-ID: <29eab9520dbe40df4579c5873463d2dfc57854e6@intel.com> (raw)
In-Reply-To: <av3GffVIJ7ZoAViU@intel.com>

On Wed, 18 Nov 2026, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Wed, Nov 18, 2026 at 03:41:01PM +0200, Jani Nikula wrote:
>> Move intel_plane_fb_max_stride() and intel_dumb_fb_max_stride() to
>> intel_fb.[ch], and make the former static as its users are now
>> exclusively in intel_fb.c.
>> 
>> As a side effect, we can reduce the display include "surface" of
>> i915_gem_create.c, as intel_display.h is quite a big header.
>
> Eventually we should perhaps consider sucking all the exported
> symbols into completely separate headers with nothing else
> in them. But no rush with that I guess.

I've been thinking about that.

Keep the headers in display/ or move to include/drm/intel/?

One big intel_display_api.h header, or multiple _api.h headers?

In the mean time it's helpful to reduce the APIs, there are still too
many. If it's a clean header with a reasonable amount of functions,
maybe a single header works.


BR,
Jani.


>
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
>> ---
>>  drivers/gpu/drm/i915/display/intel_display.c | 35 -------------------
>>  drivers/gpu/drm/i915/display/intel_display.h |  5 ---
>>  drivers/gpu/drm/i915/display/intel_fb.c      | 36 ++++++++++++++++++++
>>  drivers/gpu/drm/i915/display/intel_fb.h      |  2 ++
>>  drivers/gpu/drm/i915/gem/i915_gem_create.c   |  2 +-
>>  5 files changed, 39 insertions(+), 41 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
>> index f4d9148efde3..19caae633d29 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display.c
>> +++ b/drivers/gpu/drm/i915/display/intel_display.c
>> @@ -590,41 +590,6 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
>>  		intel_wait_for_pipe_off(old_crtc_state);
>>  }
>>  
>> -u32 intel_plane_fb_max_stride(struct intel_display *display,
>> -			      const struct drm_format_info *info,
>> -			      u64 modifier)
>> -{
>> -	struct intel_crtc *crtc;
>> -	struct intel_plane *plane;
>> -
>> -	/*
>> -	 * We assume the primary plane for pipe A has
>> -	 * the highest stride limits of them all,
>> -	 * if in case pipe A is disabled, use the first pipe from pipe_mask.
>> -	 */
>> -	crtc = intel_first_crtc(display);
>> -	if (!crtc)
>> -		return 0;
>> -
>> -	plane = to_intel_plane(crtc->base.primary);
>> -
>> -	return plane->max_stride(plane, info, modifier,
>> -				 DRM_MODE_ROTATE_0);
>> -}
>> -
>> -u32 intel_dumb_fb_max_stride(struct drm_device *drm,
>> -			     u32 pixel_format, u64 modifier)
>> -{
>> -	struct intel_display *display = to_intel_display(drm);
>> -
>> -	if (!HAS_DISPLAY(display))
>> -		return 0;
>> -
>> -	return intel_plane_fb_max_stride(display,
>> -					 drm_get_format_info(drm, pixel_format, modifier),
>> -					 modifier);
>> -}
>> -
>>  void intel_set_plane_visible(struct intel_crtc_state *crtc_state,
>>  			     struct intel_plane_state *plane_state,
>>  			     bool visible)
>> diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
>> index d53b7b4a80e7..8bb37dfe47fc 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display.h
>> @@ -356,11 +356,6 @@ void intel_link_compute_m_n(u16 bpp, int nlanes,
>>  			    int pixel_clock, int link_clock,
>>  			    int bw_overhead,
>>  			    struct intel_link_m_n *m_n);
>> -u32 intel_plane_fb_max_stride(struct intel_display *display,
>> -			      const struct drm_format_info *info,
>> -			      u64 modifier);
>> -u32 intel_dumb_fb_max_stride(struct drm_device *drm,
>> -			     u32 pixel_format, u64 modifier);
>>  enum drm_mode_status
>>  intel_mode_valid_max_plane_size(struct intel_display *display,
>>  				const struct drm_display_mode *mode,
>> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
>> index 9d71f594537f..2c63aeefaea8 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fb.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
>> @@ -12,6 +12,7 @@
>>  #include <drm/drm_print.h>
>>  
>>  #include "intel_bo.h"
>> +#include "intel_crtc.h"
>>  #include "intel_display.h"
>>  #include "intel_display_core.h"
>>  #include "intel_display_types.h"
>> @@ -1330,6 +1331,41 @@ static bool intel_plane_needs_remap(const struct intel_plane_state *plane_state)
>>  	return stride > max_stride;
>>  }
>>  
>> +static u32 intel_plane_fb_max_stride(struct intel_display *display,
>> +				     const struct drm_format_info *info,
>> +				     u64 modifier)
>> +{
>> +	struct intel_crtc *crtc;
>> +	struct intel_plane *plane;
>> +
>> +	/*
>> +	 * We assume the primary plane for pipe A has
>> +	 * the highest stride limits of them all,
>> +	 * if in case pipe A is disabled, use the first pipe from pipe_mask.
>> +	 */
>> +	crtc = intel_first_crtc(display);
>> +	if (!crtc)
>> +		return 0;
>> +
>> +	plane = to_intel_plane(crtc->base.primary);
>> +
>> +	return plane->max_stride(plane, info, modifier,
>> +				 DRM_MODE_ROTATE_0);
>> +}
>> +
>> +u32 intel_dumb_fb_max_stride(struct drm_device *drm,
>> +			     u32 pixel_format, u64 modifier)
>> +{
>> +	struct intel_display *display = to_intel_display(drm);
>> +
>> +	if (!HAS_DISPLAY(display))
>> +		return 0;
>> +
>> +	return intel_plane_fb_max_stride(display,
>> +					 drm_get_format_info(drm, pixel_format, modifier),
>> +					 modifier);
>> +}
>> +
>>  static int convert_plane_offset_to_xy(const struct intel_framebuffer *fb, int color_plane,
>>  				      int plane_width, int *x, int *y)
>>  {
>> diff --git a/drivers/gpu/drm/i915/display/intel_fb.h b/drivers/gpu/drm/i915/display/intel_fb.h
>> index 0a027e2595b2..ebf6485fd2fd 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fb.h
>> +++ b/drivers/gpu/drm/i915/display/intel_fb.h
>> @@ -119,6 +119,8 @@ intel_user_framebuffer_create(struct drm_device *dev,
>>  bool intel_fb_modifier_uses_dpt(struct intel_display *display, u64 modifier);
>>  bool intel_fb_uses_dpt(const struct drm_framebuffer *fb);
>>  
>> +u32 intel_dumb_fb_max_stride(struct drm_device *drm, u32 pixel_format, u64 modifier);
>> +
>>  unsigned int intel_fb_modifier_to_tiling(u64 fb_modifier);
>>  
>>  struct drm_gem_object *intel_fb_bo(const struct drm_framebuffer *fb);
>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_create.c b/drivers/gpu/drm/i915/gem/i915_gem_create.c
>> index e12ec59afb8d..c7ebec72a5e5 100644
>> --- a/drivers/gpu/drm/i915/gem/i915_gem_create.c
>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_create.c
>> @@ -6,7 +6,7 @@
>>  #include <drm/drm_fourcc.h>
>>  #include <drm/drm_print.h>
>>  
>> -#include "display/intel_display.h"
>> +#include "display/intel_fb.h"
>>  #include "gem/i915_gem_ioctls.h"
>>  #include "gem/i915_gem_lmem.h"
>>  #include "gem/i915_gem_region.h"
>> -- 
>> 2.47.3

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-11-18 17:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 13:41 [PATCH] drm/i915/fb: move intel_dumb_fb_max_stride() to intel_fb.[ch] Jani Nikula
2026-11-18 15:38 ` Ville Syrjälä
2026-11-18 17:01   ` Jani Nikula [this message]
2026-11-18 16:49 ` ✓ CI.KUnit: success for " Patchwork
2026-11-18 17:36 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-18 23:16 ` ✓ i915.CI.BAT: " Patchwork
2026-11-19  6:36 ` ✗ i915.CI.Full: failure " Patchwork
2026-11-19 11:13 ` ✗ Xe.CI.FULL: " 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=29eab9520dbe40df4579c5873463d2dfc57854e6@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.