[Intel-xe] [PATCH 02/15] drm/xe/stolen: don't map stolen on small-bar
Matthew Auld
matthew.auld at intel.com
Tue Feb 14 17:51:29 UTC 2023
On 14/02/2023 16:11, Lucas De Marchi wrote:
> On Tue, Feb 14, 2023 at 11:21:23AM +0000, Matthew Auld wrote:
>> The driver should still be functional with small-bar, just that the vram
>> size is clamped to the BAR size (until we add proper support for tiered
>> vram). For stolen we shouldn't iomap anything if the BAR size doesn't
>> also also contain the stolen portion. Stolen should still be functional,
>
> maybe a sentence that for the known platforms stolen is on top of
> of the device memory, so if BAR2 doesn't cover all the memory, it's not
> accessible?
Ok.
>
>
>> just that allocating CPU visible io memory will always return an error.
>>
>> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/209
>> Reported-by: Lucas De Marchi <lucas.demarchi at intel.com>
>> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>> b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>> index b4e9c88644e4..e5a992ce432a 100644
>> --- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>> +++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>> @@ -150,7 +150,7 @@ void xe_ttm_stolen_mgr_init(struct xe_device *xe)
>> drm_dbg_kms(&xe->drm, "Initialized stolen memory support with %llu
>> bytes\n",
>> stolen_size);
>>
>> - if (!xe_ttm_stolen_inaccessible(xe))
>> + if (mgr->io_base && !xe_ttm_stolen_inaccessible(xe))
>
>
> what I wrote above made me think: shouldn't the check for mgr->io_base
> be in the xe_ttm_stolen_inaccessible()? or should we differentiate
> between CPU vs GPU accessible?
Yeah, I think making it clear that this talking about CPU makes sense.
Also GPU access should always be possible. I tried to move the io_base
check into xe_ttm_stolen_inaccessible() in the next version.
>
> Lucas De Marchi
>
>> mgr->mapping = devm_ioremap_wc(&pdev->dev, mgr->io_base,
>> stolen_size);
>> }
>>
>> --
>> 2.39.1
>>
More information about the Intel-xe
mailing list