summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltán Böszörményi <zboszor@gmail.com>2021-07-08 06:14:21 +0200
committerPovilas Kanapickas <povilas@radix.lt>2021-07-30 00:27:39 +0000
commitfb5322ce2819260c07e06ab22b47df0a5d19f07d (patch)
tree5ed9448a3fcfcbd7c4bf875854bd19f0c773fc3a
parentf08bc32f5abc23ea715c15e8e86150434cc99e4f (diff)
glamoregl: Initialize glamor on the main device
This allows e.g. an UDL device (driven by llvmpipe) to be automatically set up with GPU acceleration via reverse PRIME. The result is e.g.: # 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 <zboszor@gmail.com>
-rw-r--r--glamor/glamor_egl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index dfa5d3e4f..91c36a361 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -1060,9 +1060,14 @@ 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;
+ if (scrn->confScreen->num_gpu_devices)
+ 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;
+ }
}
/*