Skip to content

Commit

Permalink
try panfrost patch
Browse files Browse the repository at this point in the history
  • Loading branch information
SolDev69 committed Aug 30, 2024
1 parent 7b0e13f commit f42e676
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,23 @@ struct pipe_screen *kmsro_drm_screen_create(int kms_fd,
#endif
} else if (strcmp(render_dev_name, "panfrost") == 0) {
#if defined(GALLIUM_PANFROST)

bool noop = getenv("KBASE_NOOP");

if (!noop) {
ro->gpu_fd = drmOpenWithType("panfrost", NULL, DRM_NODE_RENDER);
if (ro->gpu_fd < 0)
ro->gpu_fd = open("/dev/mali0", O_RDWR | O_CLOEXEC | O_NONBLOCK);
}

if ((ro->gpu_fd >= 0) || noop) {
ro->create_for_resource = panfrost_create_kms_dumb_buffer_for_resource;
screen = panfrost_drm_screen_create_renderonly(ro->gpu_fd, ro, config);
if (!screen)
goto out_free;

return screen;
}
#endif
} else if (strcmp(render_dev_name, "v3d") == 0) {
#if defined(GALLIUM_V3D)
Expand Down

0 comments on commit f42e676

Please sign in to comment.