1 2 #include "target-helpers/inline_debug_helper.h" 3 #include "state_tracker/drm_driver.h" 4 #include "i915/drm/i915_drm_public.h" 5 #include "i915/i915_public.h" 6 7 static struct pipe_screen * create_screen(int fd,const struct pipe_screen_config * config)8create_screen(int fd, const struct pipe_screen_config *config) 9 { 10 struct i915_winsys *iws; 11 struct pipe_screen *screen; 12 13 iws = i915_drm_winsys_create(fd); 14 if (!iws) 15 return NULL; 16 17 screen = i915_screen_create(iws); 18 if (!screen) 19 return NULL; 20 21 screen = debug_screen_wrap(screen); 22 23 return screen; 24 } 25 26 static const struct drm_conf_ret throttle_ret = { 27 .type = DRM_CONF_INT, 28 .val.val_int = 2, 29 }; 30 31 static const struct drm_conf_ret share_fd_ret = { 32 .type = DRM_CONF_BOOL, 33 .val.val_bool = true, 34 }; 35 drm_configuration(enum drm_conf conf)36static const struct drm_conf_ret *drm_configuration(enum drm_conf conf) 37 { 38 switch (conf) { 39 case DRM_CONF_THROTTLE: 40 return &throttle_ret; 41 case DRM_CONF_SHARE_FD: 42 return &share_fd_ret; 43 default: 44 break; 45 } 46 return NULL; 47 } 48 49 PUBLIC 50 DRM_DRIVER_DESCRIPTOR("i915", create_screen, drm_configuration) 51