Commit cc575083 authored by Huacai Chen's avatar Huacai Chen Committed by Sui Jingfeng

drm/loongson: Error out if no VRAM detected

When a Loongson laptop is equipped with a Radeon GPU, it can be true that
there is no dedicated VRAM soldered on the motherboard. This is probably
for cost reason, but drm/loongson driver is probed because the platform
BIOS (either UEFI or PMON) forget to disable the integrated GPU.

So in the lsdc_get_dedicated_vram() function, we error out if no dedicated
VRAM detected. This fix nothing, but serve as a sanity check only.
Tested-by: default avatarXiaotian Wu <wuxiaotian@loongson.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
Reviewed-by: default avatarSui Jingfeng <sui.jingfeng@linux.dev>
Signed-off-by: default avatarSui Jingfeng <sui.jingfeng@linux.dev>
Link: https://patchwork.freedesktop.org/patch/msgid/20240124101607.2910998-1-chenhuacai@loongson.cn
parent 71ce0463
...@@ -184,7 +184,7 @@ static int lsdc_get_dedicated_vram(struct lsdc_device *ldev, ...@@ -184,7 +184,7 @@ static int lsdc_get_dedicated_vram(struct lsdc_device *ldev,
drm_info(ddev, "Dedicated vram start: 0x%llx, size: %uMiB\n", drm_info(ddev, "Dedicated vram start: 0x%llx, size: %uMiB\n",
(u64)base, (u32)(size >> 20)); (u64)base, (u32)(size >> 20));
return 0; return (size > SZ_1M) ? 0 : -ENODEV;
} }
static struct lsdc_device * static struct lsdc_device *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment