summaryrefslogtreecommitdiff
path: root/src/radeon_kms.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-05-17 18:25:37 +0200
committerMichel Dänzer <michel@daenzer.net>2018-07-09 18:24:21 +0200
commiteec4a41925127ae490f0a5156a881a08d521e28e (patch)
treed1c9a3606ba9df798e0d95b77efd5e9fe1139d13 /src/radeon_kms.c
parentac18a993a3a68629805b8f272a339e25444c0897 (diff)
Only initialize libdrm_radeon surface manager for >= R600
Not used with older GPUs. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r--src/radeon_kms.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 26810e08..861fbf97 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -2228,7 +2228,16 @@ Bool RADEONScreenInit_KMS(ScreenPtr pScreen, int argc, char **argv)
if (info->r600_shadow_fb == FALSE)
info->directRenderingEnabled = radeon_dri2_screen_init(pScreen);
- info->surf_man = radeon_surface_manager_new(pRADEONEnt->fd);
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ info->surf_man = radeon_surface_manager_new(pRADEONEnt->fd);
+
+ if (!info->surf_man) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "Failed to initialize surface manager\n");
+ return FALSE;
+ }
+ }
+
if (!info->bufmgr)
info->bufmgr = radeon_bo_manager_gem_ctor(pRADEONEnt->fd);
if (!info->bufmgr) {
@@ -2694,12 +2703,7 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
pitch = RADEON_ALIGN(pScrn->virtualX, drmmode_get_pitch_align(pScrn, cpp, tiling_flags)) * cpp;
screen_size = RADEON_ALIGN(pScrn->virtualY, drmmode_get_height_align(pScrn, tiling_flags)) * pitch;
base_align = drmmode_get_base_align(pScrn, cpp, tiling_flags);
- if (info->ChipFamily >= CHIP_FAMILY_R600) {
- if(!info->surf_man) {
- xf86DrvMsg(pScreen->myNum, X_ERROR,
- "failed to initialise surface manager\n");
- return FALSE;
- }
+ if (info->surf_man) {
memset(&surface, 0, sizeof(struct radeon_surface));
surface.npix_x = pScrn->virtualX;
surface.npix_y = pScrn->virtualY;