mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 03:38:06 +02:00
kmsro: wire Zink up as a fallback
As Zink has gained support for renderonly devices, wire it up to KMSRO to allow such kind of usage. Among all renderonly drivers, Zink is a little special that it does not bind to a specific driver name, so it's made a fallback option which is checked after all driver name checks. Signed-off-by: Frank Binns <frank.binns@imgtec.com> [Icenowy: split patch, forward port, de-hardcode "powervr"] Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn> Reviewed-By: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38810>
This commit is contained in:
parent
fd50ef525d
commit
547d7f254d
5 changed files with 20 additions and 1 deletions
|
|
@ -45,6 +45,9 @@ endif
|
|||
if with_gallium_ethosu
|
||||
renderonly_drivers_c_args += '-DGALLIUM_ETHOSU'
|
||||
endif
|
||||
if with_gallium_zink
|
||||
renderonly_drivers_c_args += '-DGALLIUM_ZINK'
|
||||
endif
|
||||
|
||||
libpipe_loader_static = static_library(
|
||||
'pipe_loader_static',
|
||||
|
|
|
|||
|
|
@ -388,6 +388,9 @@ pipe_loader_get_compatible_render_capable_device_fds(int kms_only_fd, unsigned i
|
|||
#endif
|
||||
#if defined GALLIUM_VC4
|
||||
"vc4",
|
||||
#endif
|
||||
#if defined GALLIUM_ZINK
|
||||
"zink",
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -509,6 +509,9 @@ const driOptionDescription kmsro_driconf[] = {
|
|||
#ifdef GALLIUM_LIMA
|
||||
#include "lima/driinfo_lima.h"
|
||||
#endif
|
||||
#ifdef GALLIUM_ZINK
|
||||
#include "zink/driinfo_zink.h"
|
||||
#endif
|
||||
};
|
||||
DRM_DRIVER_DESCRIPTOR(kmsro, kmsro_driconf, ARRAY_SIZE(kmsro_driconf))
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "panfrost/drm/panfrost_drm_public.h"
|
||||
#include "lima/drm/lima_drm_public.h"
|
||||
#include "asahi/drm/asahi_drm_public.h"
|
||||
#include "zink/drm/zink_drm_public.h"
|
||||
#include "xf86drm.h"
|
||||
|
||||
#include "pipe/p_screen.h"
|
||||
|
|
@ -130,6 +131,13 @@ struct pipe_screen *kmsro_drm_screen_create(int kms_fd,
|
|||
|
||||
free(render_dev_name);
|
||||
|
||||
#if defined(GALLIUM_ZINK)
|
||||
if (!screen) {
|
||||
ro->create_for_resource = renderonly_create_kms_dumb_buffer_for_resource;
|
||||
screen = zink_drm_create_screen_renderonly(ro->gpu_fd, ro, config);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* test if the screen is actually graphics render capable */
|
||||
if (screen) {
|
||||
if (screen->caps.graphics)
|
||||
|
|
|
|||
|
|
@ -264,7 +264,9 @@ loader_open_render_node_platform_devices(const char * const drivers[],
|
|||
}
|
||||
|
||||
for (j = 0; j < n_drivers; j++) {
|
||||
if (strcmp(version->name, drivers[j]) == 0) {
|
||||
/* Always try to open the render device with Zink if requested */
|
||||
if (strcmp("zink", drivers[j]) == 0 ||
|
||||
strcmp(version->name, drivers[j]) == 0) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue