1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "state_tracker/drm_driver.h" 2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "target-helpers/inline_debug_helper.h" 3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "radeon/drm/radeon_drm_public.h" 4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "r600/r600_public.h" 5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic struct pipe_screen *create_screen(int fd) 7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct radeon_winsys *radeon; 9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org struct pipe_screen *screen; 10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org radeon = radeon_drm_winsys_create(fd); 12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org if (!radeon) 13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org return NULL; 14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org screen = r600_screen_create(radeon); 16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org if (!screen) 17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org return NULL; 18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org screen = debug_screen_wrap(screen); 20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org return screen; 22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct drm_conf_ret throttle_ret = { 25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org .type = DRM_CONF_INT, 26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org .val.val_int = 2, 27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct drm_conf_ret *drm_configuration(enum drm_conf conf) 30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org switch (conf) { 32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org case DRM_CONF_THROTTLE: 33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org return &throttle_ret; 34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org default: 35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org break; 36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org } 37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org return NULL; 38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgDRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen, drm_configuration) 41