return rws->fence_wait(rws, fence, timeout);
}
+static int r300_screen_get_fd(struct pipe_screen *screen)
+{
+ struct radeon_winsys *rws = r300_screen(screen)->rws;
+
+ return rws->get_fd(rws);
+}
+
struct pipe_screen* r300_screen_create(struct radeon_winsys *rws,
const struct pipe_screen_config *config)
{
r300screen->screen.get_compiler_options = r300_get_compiler_options;
r300screen->screen.get_device_vendor = r300_get_device_vendor;
r300screen->screen.get_disk_shader_cache = r300_get_disk_shader_cache;
+ r300screen->screen.get_screen_fd = r300_screen_get_fd;
r300screen->screen.get_param = r300_get_param;
r300screen->screen.get_shader_param = r300_get_shader_param;
r300screen->screen.get_paramf = r300_get_paramf;
}
}
+static int r600_get_screen_fd(struct pipe_screen *screen)
+{
+ struct radeon_winsys *ws = ((struct r600_common_screen*)screen)->ws;
+
+ return ws->get_fd(ws);
+}
+
bool r600_common_screen_init(struct r600_common_screen *rscreen,
struct radeon_winsys *ws)
{
rscreen->b.get_device_vendor = r600_get_device_vendor;
rscreen->b.get_disk_shader_cache = r600_get_disk_shader_cache;
rscreen->b.get_compute_param = r600_get_compute_param;
+ rscreen->b.get_screen_fd = r600_get_screen_fd;
rscreen->b.get_paramf = r600_get_paramf;
rscreen->b.get_timestamp = r600_get_timestamp;
rscreen->b.get_compiler_options = r600_get_compiler_options;
sscreen->info.drm_major, sscreen->info.drm_minor, kernel_version);
}
+static int si_get_screen_fd(struct pipe_screen *screen)
+{
+ struct si_screen *sscreen = (struct si_screen *)screen;
+ struct radeon_winsys *ws = sscreen->ws;
+
+ return ws->get_fd(ws);
+}
+
void si_init_screen_get_functions(struct si_screen *sscreen)
{
sscreen->b.get_name = si_get_name;
sscreen->b.get_vendor = si_get_vendor;
sscreen->b.get_device_vendor = si_get_device_vendor;
+ sscreen->b.get_screen_fd = si_get_screen_fd;
sscreen->b.get_param = si_get_param;
sscreen->b.get_paramf = si_get_paramf;
sscreen->b.get_compute_param = si_get_compute_param;
void (*destroy)(struct radeon_winsys *ws);
/**
+ * Get FD for winsys if winsys provides one
+ */
+ int (*get_fd)(struct radeon_winsys *ws);
+
+ /**
* Query an info structure from winsys.
*
* \param ws The winsys this function is called from.
return false;
}
+static int
+amdgpu_drm_winsys_get_fd(struct radeon_winsys *rws)
+{
+ struct amdgpu_screen_winsys *sws = amdgpu_screen_winsys(rws);
+
+ return sws->fd;
+}
+
PUBLIC struct radeon_winsys *
amdgpu_winsys_create(int fd, const struct pipe_screen_config *config,
radeon_screen_create_t screen_create)
/* Set functions. */
ws->base.unref = amdgpu_winsys_unref;
ws->base.destroy = amdgpu_winsys_destroy;
+ ws->base.get_fd = amdgpu_drm_winsys_get_fd;
ws->base.query_info = amdgpu_winsys_query_info;
ws->base.cs_request_feature = amdgpu_cs_request_feature;
ws->base.query_value = amdgpu_query_value;
return false;
}
+static int
+radeon_drm_winsys_get_fd(struct radeon_winsys *ws)
+{
+ struct radeon_drm_winsys *rws = (struct radeon_drm_winsys*)ws;
+
+ return rws->fd;
+}
+
PUBLIC struct radeon_winsys *
radeon_drm_winsys_create(int fd, const struct pipe_screen_config *config,
radeon_screen_create_t screen_create)
/* Set functions. */
ws->base.unref = radeon_winsys_unref;
ws->base.destroy = radeon_winsys_destroy;
+ ws->base.get_fd = radeon_drm_winsys_get_fd;
ws->base.query_info = radeon_query_info;
ws->base.pin_threads_to_L3_cache = radeon_pin_threads_to_L3_cache;
ws->base.cs_request_feature = radeon_cs_request_feature;