dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/6] drm/xe/fbdev: Fix BIOS FB vs.s stolen size check
       [not found] ` <20260205140235.338410-2-vinod.govindapillai@intel.com>
@ 2026-02-06 12:41   ` Ville Syrjälä
  0 siblings, 0 replies; only message in thread
From: Ville Syrjälä @ 2026-02-06 12:41 UTC (permalink / raw)
  To: Vinod Govindapillai
  Cc: intel-xe, intel-gfx, uma.shankar, dri-devel, Christian Koenig,
	Huang Rui, Matthew Auld, Matthew Brost, Thomas Hellström

On Thu, Feb 05, 2026 at 04:02:30PM +0200, Vinod Govindapillai wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Looks like stolen->size is in bytes, not pages. Remove the
> bogus PAGE_SHIFT stuff.

It looks to me like ttm itself is the problem here. It appears
to be a mismash of pages and bytes, and missing documentation
on which unit applies where.

Even worse, it looks like different drivers use different conventions
on what units to use. Eg. ttm_resource_manager_init() sometimes gets
passed the size in pages, sometimes in bytes. xe even uses both
units in one driver: pages in xe_ttm_sys_mgr_init(), bytes in
__xe_ttm_vram_mgr_init().

Cc'ing some ttm folks...

> 
> Also for some rnadom reason xe rejects the FB if it takes up
> exactly half of stolen, whereas i915 allows it to be used
> in that case. Adjust xe to follow the i915 rule for consistency.
> 
> v2: rebase related updates
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> ---
>  drivers/gpu/drm/xe/display/xe_initial_plane.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.c b/drivers/gpu/drm/xe/display/xe_initial_plane.c
> index 4cfeafcc158d..38ecc201ac4e 100644
> --- a/drivers/gpu/drm/xe/display/xe_initial_plane.c
> +++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c
> @@ -99,7 +99,7 @@ initial_plane_bo(struct xe_device *xe,
>  		 * features.
>  		 */
>  		if (IS_ENABLED(CONFIG_FRAMEBUFFER_CONSOLE) &&
> -		    plane_config->size * 2 >> PAGE_SHIFT >= stolen->size)
> +		    plane_config->size * 2 > stolen->size)
>  			return NULL;
>  	}
>  
> -- 
> 2.43.0

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-06 12:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260205140235.338410-1-vinod.govindapillai@intel.com>
     [not found] ` <20260205140235.338410-2-vinod.govindapillai@intel.com>
2026-02-06 12:41   ` [PATCH 1/6] drm/xe/fbdev: Fix BIOS FB vs.s stolen size check Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox