Commit 24f69d2b authored by Zoltán Böszörményi's avatar Zoltán Böszörményi
Browse files

glamoregl: Allow glamor to be initialized on llvmpipe if a GPUDevice is present



This allows an UDL device to be automatically set up with GPU
acceleration via reverse PRIME.

    # DISPLAY=:0.2 xrandr --listproviders
    Providers: number : 2
    Provider 0: id: 0xec cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 1 outputs: 1 associated providers: 1 name:modesetting
    Provider 1: id: 0x12c cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 2 associated providers: 1 name:Intel
Signed-off-by: Zoltán Böszörményi's avatarZoltán Böszörményi <zboszor@gmail.com>
parent 2145851e
Pipeline #344933 passed with stages
in 5 minutes and 11 seconds
......@@ -1060,9 +1060,24 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
goto error;
}
if (strstr((const char *)renderer, "llvmpipe")) {
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"Refusing to try glamor on llvmpipe\n");
goto error;
bool has_prime_gpu = false;
int i;
for (i = 0; i < MAX_GPUDEVICES; i++) {
if (scrn->confScreen->gpu_devices[i]) {
has_prime_gpu = true;
break;
}
}
if (has_prime_gpu)
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"Allowing glamor on llvmpipe for PRIME\n");
else {
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"Refusing to try glamor on llvmpipe\n");
goto error;
}
}
/*
......
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