diff options
Diffstat (limited to 'chromium_vaapi-other.patch')
-rw-r--r-- | chromium_vaapi-other.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/chromium_vaapi-other.patch b/chromium_vaapi-other.patch new file mode 100644 index 000000000000..52d439a84d52 --- /dev/null +++ b/chromium_vaapi-other.patch @@ -0,0 +1,75 @@ +Patch by me, Samantha McVey <samantham@posteo.net> +Attempt to load these VA-API drivers before sandbox. + +diff -aur chromium-53.0.2785.101/content/common/sandbox_linux/bpf_gpu_policy_linux.cc chromium-53.0.2785.101.new/content/common/sandbox_linux/bpf_gpu_policy_linux.cc +--- chromium-53.0.2785.101/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 2016-09-07 18:02:39.000000000 -0700 ++++ chromium-53.0.2785.101.new/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 2016-09-16 11:46:20.339655906 -0700 +@@ -96,7 +96,7 @@ + + bool IsAcceleratedVaapiVideoEncodeEnabled() { + bool accelerated_encode_enabled = false; +-#if defined(OS_CHROMEOS) ++#if defined(OS_CHROMEOS) || defined(OS_LINUX) + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + accelerated_encode_enabled = +@@ -302,19 +302,49 @@ + // inside the sandbox, so preload them now. + if (IsAcceleratedVaapiVideoEncodeEnabled() || + IsAcceleratedVideoDecodeEnabled()) { +- const char* I965DrvVideoPath = NULL; +- const char* I965HybridDrvVideoPath = NULL; ++ const char* I965_Drv_Video_Path = NULL; ++ const char* I965_Hybrid_Drv_Video_Path = NULL; ++ const char* NVIDIA_Drv_Video_Path = NULL; ++ const char* LIB_VA_Path = NULL; ++ const char* LIB_VA_X11_Path = NULL; ++ const char* R600_Drv_VideoPath = NULL; ++ const char* RADEONSIDrvVideoPath = NULL; ++ const char* VDPAU_Drv_VideoPath = NULL; ++ ++ if (IsArchitectureX86_64() || IsArchitectureI386() ) { ++ I965_Drv_Video_Path = "/usr/lib/dri/i965_drv_video.so"; ++ I965_Hybrid_Drv_Video_Path = "/usr/lib/dri/hybrid_drv_video.so"; ++ NVIDIA_Drv_Video_Path = "/usr/lib/dri/nvidia_drv_video.so"; ++ R600_Drv_VideoPath = "/usr/lib/dri/r600_drv_video.so"; ++ VDPAU_Drv_VideoPath = "/usr/lib/dri/vdpau_drv_video.so"; ++ RADEONSI_Drv_VideoPath = "/usr/lib/dri/radeonsi_drv_video.so"; ++ NOUVEAU_Drv_VideoPath = "/usr/lib/dri/nouveau_drv_video.so"; + +- if (IsArchitectureX86_64()) { +- I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; +- I965HybridDrvVideoPath = "/usr/lib64/va/drivers/hybrid_drv_video.so"; +- } else if (IsArchitectureI386()) { +- I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; ++ LIB_VA_Path = "/usr/lib/libva.so.1"; ++ LIB_VA_X11_Path = "/usr/lib/libva-x11.so.1"; ++ } ++ if ( access(I965_Drv_Video_Path , X_OK|R_OK ) != -1 ) { ++ dlopen(I965_Drv_Video_Path, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); ++ } ++ if ( access(I965_Hybrid_Drv_Video_Path , X_OK|R_OK ) != -1 ) { ++ dlopen(I965_Hybrid_Drv_Video_Path, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); ++ } ++ if ( access(VDPAU_Drv_VideoPath , X_OK|R_OK ) != -1 ) { ++ dlopen(VDPAU_Drv_VideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); ++ } ++ if ( access(NVIDIA_Drv_Video_Path , X_OK|R_OK ) != -1 ) { ++ dlopen(NVIDIA_Drv_Video_Path, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); ++ } ++ if ( access(R600_Drv_VideoPath , X_OK|R_OK ) != -1 ) { ++ dlopen(R600_Drv_VideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); ++ } ++ if ( access(RADEONSI_Drv_VideoPath , X_OK|R_OK ) != -1 ) { ++ dlopen(RADEONSI_Drv_VideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); ++ } ++ if ( access(NOUVEAU_Drv_VideoPath , X_OK|R_OK ) != -1 ) { ++ dlopen(NOUVEAU_Drv_VideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); + } + +- dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); +- if (I965HybridDrvVideoPath) +- dlopen(I965HybridDrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); + dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); + #if defined(USE_OZONE) + dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |