• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "target-helpers/inline_debug_helper.h"
2 #include "state_tracker/drm_driver.h"
3 #include "radeon/drm/radeon_drm_public.h"
4 #include "radeon/radeon_winsys.h"
5 #include "r300/r300_public.h"
6 
7 static struct pipe_screen *
create_screen(int fd,const struct pipe_screen_config * config)8 create_screen(int fd, const struct pipe_screen_config *config)
9 {
10    struct radeon_winsys *sws;
11 
12    sws = radeon_drm_winsys_create(fd, config, r300_screen_create);
13    return sws ? debug_screen_wrap(sws->screen) : NULL;
14 }
15 
16 static const struct drm_conf_ret throttle_ret = {
17    .type = DRM_CONF_INT,
18    .val.val_int = 2,
19 };
20 
21 static const struct drm_conf_ret share_fd_ret = {
22    .type = DRM_CONF_BOOL,
23    .val.val_bool = true,
24 };
25 
drm_configuration(enum drm_conf conf)26 static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
27 {
28    switch (conf) {
29    case DRM_CONF_THROTTLE:
30       return &throttle_ret;
31    case DRM_CONF_SHARE_FD:
32       return &share_fd_ret;
33    default:
34       break;
35    }
36    return NULL;
37 }
38 
39 PUBLIC
40 DRM_DRIVER_DESCRIPTOR("r300", create_screen, drm_configuration)
41