<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">Hi,
</span><br>
<br>
This patch works fine with my Loongson 3A5000 laptop (GDC-1401),
which has a <br>
7A1000 chipset without VRAM.
<br>
<br>
lspci |grep VGA
<br>
00:06.1 VGA compatible controller: Loongson Technology LLC DC
(Display Controller) (rev 01)
<br>
07:00.0 VGA compatible controller: Advanced Micro Devices, Inc.
[AMD/ATI] Oland [Radeon HD 8570 / R5 430 OEM / R7 240/340 /
Radeon 520 OEM] (rev 87)<br>
</span></p>
<div class="moz-cite-prefix">在 2024/1/19 18:40, Huacai Chen 写道:<br>
</div>
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">If there is no VRAM (it is true if there is a discreted card), we get
such an error and Xorg fails to start:
[ 136.401131] loongson 0000:00:06.1: [drm] *ERROR* Requesting(0MiB) failed
[ 137.444342] loongson 0000:00:06.1: [drm] *ERROR* Requesting(0MiB) failed
[ 138.871166] loongson 0000:00:06.1: [drm] *ERROR* Requesting(0MiB) failed
[ 140.444078] loongson 0000:00:06.1: [drm] *ERROR* Requesting(0MiB) failed
[ 142.403993] loongson 0000:00:06.1: [drm] *ERROR* Requesting(0MiB) failed
[ 143.970625] loongson 0000:00:06.1: [drm] *ERROR* Requesting(0MiB) failed
[ 145.862013] loongson 0000:00:06.1: [drm] *ERROR* Requesting(0MiB) failed
So in lsdc_get_dedicated_vram() we error out if no VRAM (or VRAM is less
than 1MB which is also an unusable case) detected.
Signed-off-by: Huacai Chen <a class="moz-txt-link-rfc2396E" href="mailto:chenhuacai@loongson.cn"><chenhuacai@loongson.cn></a>
---
drivers/gpu/drm/loongson/lsdc_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/loongson/lsdc_drv.c b/drivers/gpu/drm/loongson/lsdc_drv.c
index 89ccc0c43169..d8ff60b46abe 100644
--- a/drivers/gpu/drm/loongson/lsdc_drv.c
+++ b/drivers/gpu/drm/loongson/lsdc_drv.c
@@ -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",
(u64)base, (u32)(size >> 20));
- return 0;
+ return (size > SZ_1M) ? 0 : -ENODEV;
}
static struct lsdc_device *
</pre>
</blockquote>
</body>
</html>