1bf215546Sopenharmony_ci#ifndef DRM_HELPER_H 2bf215546Sopenharmony_ci#define DRM_HELPER_H 3bf215546Sopenharmony_ci 4bf215546Sopenharmony_ci#include <stdio.h> 5bf215546Sopenharmony_ci#include "target-helpers/inline_debug_helper.h" 6bf215546Sopenharmony_ci#include "target-helpers/drm_helper_public.h" 7bf215546Sopenharmony_ci#include "frontend/drm_driver.h" 8bf215546Sopenharmony_ci#include "util/driconf.h" 9bf215546Sopenharmony_ci 10bf215546Sopenharmony_ci/** 11bf215546Sopenharmony_ci * Instantiate a drm_driver_descriptor struct. 12bf215546Sopenharmony_ci */ 13bf215546Sopenharmony_ci#define DEFINE_DRM_DRIVER_DESCRIPTOR(descriptor_name, driver, _driconf, _driconf_count, func) \ 14bf215546Sopenharmony_ciconst struct drm_driver_descriptor descriptor_name = { \ 15bf215546Sopenharmony_ci .driver_name = #driver, \ 16bf215546Sopenharmony_ci .driconf = _driconf, \ 17bf215546Sopenharmony_ci .driconf_count = _driconf_count, \ 18bf215546Sopenharmony_ci .create_screen = func, \ 19bf215546Sopenharmony_ci}; 20bf215546Sopenharmony_ci 21bf215546Sopenharmony_ci/* The static pipe loader refers to the *_driver_descriptor structs for all 22bf215546Sopenharmony_ci * drivers, regardless of whether they are configured in this Mesa build, or 23bf215546Sopenharmony_ci * whether they're included in the specific gallium target. The target (dri, 24bf215546Sopenharmony_ci * vdpau, etc.) will include this header with the #defines for the specific 25bf215546Sopenharmony_ci * drivers it's including, and the disabled drivers will have a descriptor 26bf215546Sopenharmony_ci * with a stub create function logging the failure. 27bf215546Sopenharmony_ci * 28bf215546Sopenharmony_ci * The dynamic pipe loader instead has target/pipeloader/pipe_*.c including 29bf215546Sopenharmony_ci * this header in a pipe_*.so for each driver which will have one driver's 30bf215546Sopenharmony_ci * GALLIUM_* defined. We make a single driver_descriptor entrypoint that is 31bf215546Sopenharmony_ci * dlsym()ed by the dynamic pipe loader. 32bf215546Sopenharmony_ci */ 33bf215546Sopenharmony_ci 34bf215546Sopenharmony_ci#ifdef PIPE_LOADER_DYNAMIC 35bf215546Sopenharmony_ci 36bf215546Sopenharmony_ci#define DRM_DRIVER_DESCRIPTOR(driver, driconf, driconf_count) \ 37bf215546Sopenharmony_ci PUBLIC DEFINE_DRM_DRIVER_DESCRIPTOR(driver_descriptor, driver, driconf, driconf_count, pipe_##driver##_create_screen) 38bf215546Sopenharmony_ci 39bf215546Sopenharmony_ci#define DRM_DRIVER_DESCRIPTOR_STUB(driver) 40bf215546Sopenharmony_ci 41bf215546Sopenharmony_ci#define DRM_DRIVER_DESCRIPTOR_ALIAS(driver, alias, driconf, driconf_count) 42bf215546Sopenharmony_ci 43bf215546Sopenharmony_ci#else 44bf215546Sopenharmony_ci 45bf215546Sopenharmony_ci#define DRM_DRIVER_DESCRIPTOR(driver, driconf, driconf_count) \ 46bf215546Sopenharmony_ci DEFINE_DRM_DRIVER_DESCRIPTOR(driver##_driver_descriptor, driver, driconf, driconf_count, pipe_##driver##_create_screen) 47bf215546Sopenharmony_ci 48bf215546Sopenharmony_ci#define DRM_DRIVER_DESCRIPTOR_STUB(driver) \ 49bf215546Sopenharmony_ci static struct pipe_screen * \ 50bf215546Sopenharmony_ci pipe_##driver##_create_screen(int fd, const struct pipe_screen_config *config) \ 51bf215546Sopenharmony_ci { \ 52bf215546Sopenharmony_ci fprintf(stderr, #driver ": driver missing\n"); \ 53bf215546Sopenharmony_ci return NULL; \ 54bf215546Sopenharmony_ci } \ 55bf215546Sopenharmony_ci DRM_DRIVER_DESCRIPTOR(driver, NULL, 0) 56bf215546Sopenharmony_ci 57bf215546Sopenharmony_ci#define DRM_DRIVER_DESCRIPTOR_ALIAS(driver, alias, driconf, driconf_count) \ 58bf215546Sopenharmony_ci DEFINE_DRM_DRIVER_DESCRIPTOR(alias##_driver_descriptor, alias, driconf, \ 59bf215546Sopenharmony_ci driconf_count, pipe_##driver##_create_screen) 60bf215546Sopenharmony_ci 61bf215546Sopenharmony_ci#endif 62bf215546Sopenharmony_ci 63bf215546Sopenharmony_ci#ifdef GALLIUM_KMSRO_ONLY 64bf215546Sopenharmony_ci#undef GALLIUM_V3D 65bf215546Sopenharmony_ci#undef GALLIUM_VC4 66bf215546Sopenharmony_ci#undef GALLIUM_FREEDRENO 67bf215546Sopenharmony_ci#undef GALLIUM_ETNAVIV 68bf215546Sopenharmony_ci#undef GALLIUM_PANFROST 69bf215546Sopenharmony_ci#undef GALLIUM_LIMA 70bf215546Sopenharmony_ci#endif 71bf215546Sopenharmony_ci 72bf215546Sopenharmony_ci#ifdef GALLIUM_I915 73bf215546Sopenharmony_ci#include "i915/drm/i915_drm_public.h" 74bf215546Sopenharmony_ci#include "i915/i915_public.h" 75bf215546Sopenharmony_ci 76bf215546Sopenharmony_cistatic struct pipe_screen * 77bf215546Sopenharmony_cipipe_i915_create_screen(int fd, const struct pipe_screen_config *config) 78bf215546Sopenharmony_ci{ 79bf215546Sopenharmony_ci struct i915_winsys *iws; 80bf215546Sopenharmony_ci struct pipe_screen *screen; 81bf215546Sopenharmony_ci 82bf215546Sopenharmony_ci iws = i915_drm_winsys_create(fd); 83bf215546Sopenharmony_ci if (!iws) 84bf215546Sopenharmony_ci return NULL; 85bf215546Sopenharmony_ci 86bf215546Sopenharmony_ci screen = i915_screen_create(iws); 87bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 88bf215546Sopenharmony_ci} 89bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(i915, NULL, 0) 90bf215546Sopenharmony_ci#else 91bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(i915) 92bf215546Sopenharmony_ci#endif 93bf215546Sopenharmony_ci 94bf215546Sopenharmony_ci#ifdef GALLIUM_IRIS 95bf215546Sopenharmony_ci#include "iris/drm/iris_drm_public.h" 96bf215546Sopenharmony_ci 97bf215546Sopenharmony_cistatic struct pipe_screen * 98bf215546Sopenharmony_cipipe_iris_create_screen(int fd, const struct pipe_screen_config *config) 99bf215546Sopenharmony_ci{ 100bf215546Sopenharmony_ci struct pipe_screen *screen; 101bf215546Sopenharmony_ci 102bf215546Sopenharmony_ci screen = iris_drm_screen_create(fd, config); 103bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 104bf215546Sopenharmony_ci} 105bf215546Sopenharmony_ci 106bf215546Sopenharmony_ciconst driOptionDescription iris_driconf[] = { 107bf215546Sopenharmony_ci #include "iris/driinfo_iris.h" 108bf215546Sopenharmony_ci}; 109bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(iris, iris_driconf, ARRAY_SIZE(iris_driconf)) 110bf215546Sopenharmony_ci 111bf215546Sopenharmony_ci#else 112bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(iris) 113bf215546Sopenharmony_ci#endif 114bf215546Sopenharmony_ci 115bf215546Sopenharmony_ci#ifdef GALLIUM_CROCUS 116bf215546Sopenharmony_ci#include "crocus/drm/crocus_drm_public.h" 117bf215546Sopenharmony_ci 118bf215546Sopenharmony_cistatic struct pipe_screen * 119bf215546Sopenharmony_cipipe_crocus_create_screen(int fd, const struct pipe_screen_config *config) 120bf215546Sopenharmony_ci{ 121bf215546Sopenharmony_ci struct pipe_screen *screen; 122bf215546Sopenharmony_ci 123bf215546Sopenharmony_ci screen = crocus_drm_screen_create(fd, config); 124bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 125bf215546Sopenharmony_ci} 126bf215546Sopenharmony_ci 127bf215546Sopenharmony_ciconst driOptionDescription crocus_driconf[] = { 128bf215546Sopenharmony_ci #include "crocus/driinfo_crocus.h" 129bf215546Sopenharmony_ci}; 130bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(crocus, crocus_driconf, ARRAY_SIZE(crocus_driconf)) 131bf215546Sopenharmony_ci#else 132bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(crocus) 133bf215546Sopenharmony_ci#endif 134bf215546Sopenharmony_ci 135bf215546Sopenharmony_ci#ifdef GALLIUM_NOUVEAU 136bf215546Sopenharmony_ci#include "nouveau/drm/nouveau_drm_public.h" 137bf215546Sopenharmony_ci 138bf215546Sopenharmony_cistatic struct pipe_screen * 139bf215546Sopenharmony_cipipe_nouveau_create_screen(int fd, const struct pipe_screen_config *config) 140bf215546Sopenharmony_ci{ 141bf215546Sopenharmony_ci struct pipe_screen *screen; 142bf215546Sopenharmony_ci 143bf215546Sopenharmony_ci screen = nouveau_drm_screen_create(fd); 144bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 145bf215546Sopenharmony_ci} 146bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(nouveau, NULL, 0) 147bf215546Sopenharmony_ci 148bf215546Sopenharmony_ci#else 149bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(nouveau) 150bf215546Sopenharmony_ci#endif 151bf215546Sopenharmony_ci 152bf215546Sopenharmony_ci#if defined(GALLIUM_VC4) || defined(GALLIUM_V3D) 153bf215546Sopenharmony_ciconst driOptionDescription v3d_driconf[] = { 154bf215546Sopenharmony_ci #include "v3d/driinfo_v3d.h" 155bf215546Sopenharmony_ci}; 156bf215546Sopenharmony_ci#endif 157bf215546Sopenharmony_ci 158bf215546Sopenharmony_ci#ifdef GALLIUM_KMSRO 159bf215546Sopenharmony_ci#include "kmsro/drm/kmsro_drm_public.h" 160bf215546Sopenharmony_ci 161bf215546Sopenharmony_cistatic struct pipe_screen * 162bf215546Sopenharmony_cipipe_kmsro_create_screen(int fd, const struct pipe_screen_config *config) 163bf215546Sopenharmony_ci{ 164bf215546Sopenharmony_ci struct pipe_screen *screen; 165bf215546Sopenharmony_ci 166bf215546Sopenharmony_ci screen = kmsro_drm_screen_create(fd, config); 167bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 168bf215546Sopenharmony_ci} 169bf215546Sopenharmony_ci#if defined(GALLIUM_VC4) || defined(GALLIUM_V3D) 170bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(kmsro, v3d_driconf, ARRAY_SIZE(v3d_driconf)) 171bf215546Sopenharmony_ci#else 172bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(kmsro, NULL, 0) 173bf215546Sopenharmony_ci#endif 174bf215546Sopenharmony_ci 175bf215546Sopenharmony_ci#else 176bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(kmsro) 177bf215546Sopenharmony_ci#endif 178bf215546Sopenharmony_ci 179bf215546Sopenharmony_ci#ifdef GALLIUM_R300 180bf215546Sopenharmony_ci#include "winsys/radeon_winsys.h" 181bf215546Sopenharmony_ci#include "r300/r300_public.h" 182bf215546Sopenharmony_ci 183bf215546Sopenharmony_cistatic struct pipe_screen * 184bf215546Sopenharmony_cipipe_r300_create_screen(int fd, const struct pipe_screen_config *config) 185bf215546Sopenharmony_ci{ 186bf215546Sopenharmony_ci struct radeon_winsys *rw; 187bf215546Sopenharmony_ci 188bf215546Sopenharmony_ci rw = radeon_drm_winsys_create(fd, config, r300_screen_create); 189bf215546Sopenharmony_ci return rw ? debug_screen_wrap(rw->screen) : NULL; 190bf215546Sopenharmony_ci} 191bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(r300, NULL, 0) 192bf215546Sopenharmony_ci 193bf215546Sopenharmony_ci#else 194bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(r300) 195bf215546Sopenharmony_ci#endif 196bf215546Sopenharmony_ci 197bf215546Sopenharmony_ci#ifdef GALLIUM_R600 198bf215546Sopenharmony_ci#include "winsys/radeon_winsys.h" 199bf215546Sopenharmony_ci#include "r600/r600_public.h" 200bf215546Sopenharmony_ci 201bf215546Sopenharmony_cistatic struct pipe_screen * 202bf215546Sopenharmony_cipipe_r600_create_screen(int fd, const struct pipe_screen_config *config) 203bf215546Sopenharmony_ci{ 204bf215546Sopenharmony_ci struct radeon_winsys *rw; 205bf215546Sopenharmony_ci 206bf215546Sopenharmony_ci rw = radeon_drm_winsys_create(fd, config, r600_screen_create); 207bf215546Sopenharmony_ci return rw ? debug_screen_wrap(rw->screen) : NULL; 208bf215546Sopenharmony_ci} 209bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(r600, NULL, 0) 210bf215546Sopenharmony_ci 211bf215546Sopenharmony_ci#else 212bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(r600) 213bf215546Sopenharmony_ci#endif 214bf215546Sopenharmony_ci 215bf215546Sopenharmony_ci#ifdef GALLIUM_RADEONSI 216bf215546Sopenharmony_ci#include "radeonsi/si_public.h" 217bf215546Sopenharmony_ci 218bf215546Sopenharmony_cistatic struct pipe_screen * 219bf215546Sopenharmony_cipipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config) 220bf215546Sopenharmony_ci{ 221bf215546Sopenharmony_ci struct pipe_screen *screen = radeonsi_screen_create(fd, config); 222bf215546Sopenharmony_ci 223bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 224bf215546Sopenharmony_ci} 225bf215546Sopenharmony_ci 226bf215546Sopenharmony_ciconst driOptionDescription radeonsi_driconf[] = { 227bf215546Sopenharmony_ci #include "radeonsi/driinfo_radeonsi.h" 228bf215546Sopenharmony_ci}; 229bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(radeonsi, radeonsi_driconf, ARRAY_SIZE(radeonsi_driconf)) 230bf215546Sopenharmony_ci 231bf215546Sopenharmony_ci#else 232bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(radeonsi) 233bf215546Sopenharmony_ci#endif 234bf215546Sopenharmony_ci 235bf215546Sopenharmony_ci#ifdef GALLIUM_VMWGFX 236bf215546Sopenharmony_ci#include "svga/drm/svga_drm_public.h" 237bf215546Sopenharmony_ci#include "svga/svga_public.h" 238bf215546Sopenharmony_ci 239bf215546Sopenharmony_cistatic struct pipe_screen * 240bf215546Sopenharmony_cipipe_vmwgfx_create_screen(int fd, const struct pipe_screen_config *config) 241bf215546Sopenharmony_ci{ 242bf215546Sopenharmony_ci struct svga_winsys_screen *sws; 243bf215546Sopenharmony_ci struct pipe_screen *screen; 244bf215546Sopenharmony_ci 245bf215546Sopenharmony_ci sws = svga_drm_winsys_screen_create(fd); 246bf215546Sopenharmony_ci if (!sws) 247bf215546Sopenharmony_ci return NULL; 248bf215546Sopenharmony_ci 249bf215546Sopenharmony_ci screen = svga_screen_create(sws); 250bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 251bf215546Sopenharmony_ci} 252bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(vmwgfx, NULL, 0) 253bf215546Sopenharmony_ci 254bf215546Sopenharmony_ci#else 255bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(vmwgfx) 256bf215546Sopenharmony_ci#endif 257bf215546Sopenharmony_ci 258bf215546Sopenharmony_ci#ifdef GALLIUM_FREEDRENO 259bf215546Sopenharmony_ci#include "freedreno/drm/freedreno_drm_public.h" 260bf215546Sopenharmony_ci 261bf215546Sopenharmony_cistatic struct pipe_screen * 262bf215546Sopenharmony_cipipe_msm_create_screen(int fd, const struct pipe_screen_config *config) 263bf215546Sopenharmony_ci{ 264bf215546Sopenharmony_ci struct pipe_screen *screen; 265bf215546Sopenharmony_ci 266bf215546Sopenharmony_ci screen = fd_drm_screen_create(fd, NULL, config); 267bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 268bf215546Sopenharmony_ci} 269bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(msm, NULL, 0) 270bf215546Sopenharmony_ci#else 271bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(msm) 272bf215546Sopenharmony_ci#endif 273bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_ALIAS(msm, kgsl, NULL, 0) 274bf215546Sopenharmony_ci 275bf215546Sopenharmony_ci#if defined(GALLIUM_VIRGL) || (defined(GALLIUM_FREEDRENO) && !defined(PIPE_LOADER_DYNAMIC)) 276bf215546Sopenharmony_ci#include "virgl/drm/virgl_drm_public.h" 277bf215546Sopenharmony_ci#include "virgl/virgl_public.h" 278bf215546Sopenharmony_ci 279bf215546Sopenharmony_cistatic struct pipe_screen * 280bf215546Sopenharmony_cipipe_virtio_gpu_create_screen(int fd, const struct pipe_screen_config *config) 281bf215546Sopenharmony_ci{ 282bf215546Sopenharmony_ci struct pipe_screen *screen = NULL; 283bf215546Sopenharmony_ci 284bf215546Sopenharmony_ci /* Try native guest driver(s) first, and then fallback to virgl: */ 285bf215546Sopenharmony_ci#ifdef GALLIUM_FREEDRENO 286bf215546Sopenharmony_ci if (!screen) 287bf215546Sopenharmony_ci screen = fd_drm_screen_create(fd, NULL, config); 288bf215546Sopenharmony_ci#endif 289bf215546Sopenharmony_ci#ifdef GALLIUM_VIRGL 290bf215546Sopenharmony_ci if (!screen) 291bf215546Sopenharmony_ci screen = virgl_drm_screen_create(fd, config); 292bf215546Sopenharmony_ci#endif 293bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 294bf215546Sopenharmony_ci} 295bf215546Sopenharmony_ci 296bf215546Sopenharmony_ciconst driOptionDescription virgl_driconf[] = { 297bf215546Sopenharmony_ci#ifdef GALLIUM_VIRGL 298bf215546Sopenharmony_ci #include "virgl/virgl_driinfo.h.in" 299bf215546Sopenharmony_ci#endif 300bf215546Sopenharmony_ci}; 301bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(virtio_gpu, virgl_driconf, ARRAY_SIZE(virgl_driconf)) 302bf215546Sopenharmony_ci 303bf215546Sopenharmony_ci#else 304bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(virtio_gpu) 305bf215546Sopenharmony_ci#endif 306bf215546Sopenharmony_ci 307bf215546Sopenharmony_ci#ifdef GALLIUM_VC4 308bf215546Sopenharmony_ci#include "vc4/drm/vc4_drm_public.h" 309bf215546Sopenharmony_ci 310bf215546Sopenharmony_cistatic struct pipe_screen * 311bf215546Sopenharmony_cipipe_vc4_create_screen(int fd, const struct pipe_screen_config *config) 312bf215546Sopenharmony_ci{ 313bf215546Sopenharmony_ci struct pipe_screen *screen; 314bf215546Sopenharmony_ci 315bf215546Sopenharmony_ci screen = vc4_drm_screen_create(fd, config); 316bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 317bf215546Sopenharmony_ci} 318bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(vc4, v3d_driconf, ARRAY_SIZE(v3d_driconf)) 319bf215546Sopenharmony_ci#else 320bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(vc4) 321bf215546Sopenharmony_ci#endif 322bf215546Sopenharmony_ci 323bf215546Sopenharmony_ci#ifdef GALLIUM_V3D 324bf215546Sopenharmony_ci#include "v3d/drm/v3d_drm_public.h" 325bf215546Sopenharmony_ci 326bf215546Sopenharmony_cistatic struct pipe_screen * 327bf215546Sopenharmony_cipipe_v3d_create_screen(int fd, const struct pipe_screen_config *config) 328bf215546Sopenharmony_ci{ 329bf215546Sopenharmony_ci struct pipe_screen *screen; 330bf215546Sopenharmony_ci 331bf215546Sopenharmony_ci screen = v3d_drm_screen_create(fd, config); 332bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 333bf215546Sopenharmony_ci} 334bf215546Sopenharmony_ci 335bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(v3d, v3d_driconf, ARRAY_SIZE(v3d_driconf)) 336bf215546Sopenharmony_ci 337bf215546Sopenharmony_ci#else 338bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(v3d) 339bf215546Sopenharmony_ci#endif 340bf215546Sopenharmony_ci 341bf215546Sopenharmony_ci#ifdef GALLIUM_PANFROST 342bf215546Sopenharmony_ci#include "panfrost/drm/panfrost_drm_public.h" 343bf215546Sopenharmony_ci 344bf215546Sopenharmony_cistatic struct pipe_screen * 345bf215546Sopenharmony_cipipe_panfrost_create_screen(int fd, const struct pipe_screen_config *config) 346bf215546Sopenharmony_ci{ 347bf215546Sopenharmony_ci struct pipe_screen *screen; 348bf215546Sopenharmony_ci 349bf215546Sopenharmony_ci screen = panfrost_drm_screen_create(fd); 350bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 351bf215546Sopenharmony_ci} 352bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(panfrost, NULL, 0) 353bf215546Sopenharmony_ci 354bf215546Sopenharmony_ci#else 355bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(panfrost) 356bf215546Sopenharmony_ci#endif 357bf215546Sopenharmony_ci 358bf215546Sopenharmony_ci#ifdef GALLIUM_ETNAVIV 359bf215546Sopenharmony_ci#include "etnaviv/drm/etnaviv_drm_public.h" 360bf215546Sopenharmony_ci 361bf215546Sopenharmony_cistatic struct pipe_screen * 362bf215546Sopenharmony_cipipe_etnaviv_create_screen(int fd, const struct pipe_screen_config *config) 363bf215546Sopenharmony_ci{ 364bf215546Sopenharmony_ci struct pipe_screen *screen; 365bf215546Sopenharmony_ci 366bf215546Sopenharmony_ci screen = etna_drm_screen_create(fd); 367bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 368bf215546Sopenharmony_ci} 369bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(etnaviv, NULL, 0) 370bf215546Sopenharmony_ci 371bf215546Sopenharmony_ci#else 372bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(etnaviv) 373bf215546Sopenharmony_ci#endif 374bf215546Sopenharmony_ci 375bf215546Sopenharmony_ci#ifdef GALLIUM_TEGRA 376bf215546Sopenharmony_ci#include "tegra/drm/tegra_drm_public.h" 377bf215546Sopenharmony_ci 378bf215546Sopenharmony_cistatic struct pipe_screen * 379bf215546Sopenharmony_cipipe_tegra_create_screen(int fd, const struct pipe_screen_config *config) 380bf215546Sopenharmony_ci{ 381bf215546Sopenharmony_ci struct pipe_screen *screen; 382bf215546Sopenharmony_ci 383bf215546Sopenharmony_ci screen = tegra_drm_screen_create(fd); 384bf215546Sopenharmony_ci 385bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 386bf215546Sopenharmony_ci} 387bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(tegra, NULL, 0) 388bf215546Sopenharmony_ci 389bf215546Sopenharmony_ci#else 390bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(tegra) 391bf215546Sopenharmony_ci#endif 392bf215546Sopenharmony_ci 393bf215546Sopenharmony_ci#ifdef GALLIUM_LIMA 394bf215546Sopenharmony_ci#include "lima/drm/lima_drm_public.h" 395bf215546Sopenharmony_ci 396bf215546Sopenharmony_cistatic struct pipe_screen * 397bf215546Sopenharmony_cipipe_lima_create_screen(int fd, const struct pipe_screen_config *config) 398bf215546Sopenharmony_ci{ 399bf215546Sopenharmony_ci struct pipe_screen *screen; 400bf215546Sopenharmony_ci 401bf215546Sopenharmony_ci screen = lima_drm_screen_create(fd); 402bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 403bf215546Sopenharmony_ci} 404bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(lima, NULL, 0) 405bf215546Sopenharmony_ci 406bf215546Sopenharmony_ci#else 407bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(lima) 408bf215546Sopenharmony_ci#endif 409bf215546Sopenharmony_ci 410bf215546Sopenharmony_ci#ifdef GALLIUM_ZINK 411bf215546Sopenharmony_ci#include "zink/zink_public.h" 412bf215546Sopenharmony_ci 413bf215546Sopenharmony_cistatic struct pipe_screen * 414bf215546Sopenharmony_cipipe_zink_create_screen(int fd, const struct pipe_screen_config *config) 415bf215546Sopenharmony_ci{ 416bf215546Sopenharmony_ci struct pipe_screen *screen; 417bf215546Sopenharmony_ci screen = zink_drm_create_screen(fd, config); 418bf215546Sopenharmony_ci return screen ? debug_screen_wrap(screen) : NULL; 419bf215546Sopenharmony_ci} 420bf215546Sopenharmony_ci 421bf215546Sopenharmony_ciconst driOptionDescription zink_driconf[] = { 422bf215546Sopenharmony_ci #include "zink/driinfo_zink.h" 423bf215546Sopenharmony_ci}; 424bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR(zink, zink_driconf, ARRAY_SIZE(zink_driconf)) 425bf215546Sopenharmony_ci 426bf215546Sopenharmony_ci#else 427bf215546Sopenharmony_ciDRM_DRIVER_DESCRIPTOR_STUB(zink) 428bf215546Sopenharmony_ci#endif 429bf215546Sopenharmony_ci 430bf215546Sopenharmony_ci#endif /* DRM_HELPER_H */ 431