diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-02-10 01:59:49 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-02-10 01:59:49 +0000 |
commit | f7542477870994263cf0ae3a280fb65447d08c4a (patch) | |
tree | 4145bb9dbe003ee1e57448af3d33860211264328 | |
parent | 7788a922fb849cee7c1d1006f3a87ec129f6668d (diff) |
drm/radeon: expose render backend mask to the userspace
From Marek Olsak
413f46c51b173d8a46135d33fa3adef05f2b1a7e in ubuntu 3.8
439a1cfffe2c1a06e5a6394ccd5d18a8e89b15d3 in mainline linux
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon.h | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon_kms.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/si.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon_drm.h | 4 |
4 files changed, 16 insertions, 5 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon.h b/sys/dev/pci/drm/radeon/radeon.h index ca8c0da7b0d..b6debf92995 100644 --- a/sys/dev/pci/drm/radeon/radeon.h +++ b/sys/dev/pci/drm/radeon/radeon.h @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon.h,v 1.6 2014/02/09 23:57:04 jsg Exp $ */ +/* $OpenBSD: radeon.h,v 1.7 2014/02/10 01:59:48 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -1427,7 +1427,7 @@ struct si_asic { unsigned sc_earlyz_tile_fifo_size; unsigned num_tile_pipes; - unsigned num_backends_per_se; + unsigned backend_enable_mask; unsigned backend_disable_mask_per_asic; unsigned backend_map; unsigned num_texture_channel_caches; diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c index 3c5ad078217..1aa36333999 100644 --- a/sys/dev/pci/drm/radeon/radeon_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_kms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_kms.c,v 1.21 2014/02/10 00:47:19 jsg Exp $ */ +/* $OpenBSD: radeon_kms.c,v 1.22 2014/02/10 01:59:48 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -986,6 +986,13 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) case RADEON_INFO_SI_CP_DMA_COMPUTE: value = 1; break; + case RADEON_INFO_SI_BACKEND_ENABLED_MASK: + if (rdev->family >= CHIP_TAHITI) { + value = rdev->config.si.backend_enable_mask; + } else { + DRM_DEBUG_KMS("BACKEND_ENABLED_MASK is si+ only!\n"); + } + break; default: DRM_DEBUG_KMS("Invalid request %d\n", info->request); return -EINVAL; diff --git a/sys/dev/pci/drm/radeon/si.c b/sys/dev/pci/drm/radeon/si.c index 43a1d231a5f..a7b84fb35ab 100644 --- a/sys/dev/pci/drm/radeon/si.c +++ b/sys/dev/pci/drm/radeon/si.c @@ -1,4 +1,4 @@ -/* $OpenBSD: si.c,v 1.12 2014/02/10 01:35:49 jsg Exp $ */ +/* $OpenBSD: si.c,v 1.13 2014/02/10 01:59:48 jsg Exp $ */ /* * Copyright 2011 Advanced Micro Devices, Inc. * @@ -1504,6 +1504,8 @@ static void si_setup_rb(struct radeon_device *rdev, mask <<= 1; } + rdev->config.si.backend_enable_mask = enabled_rbs; + for (i = 0; i < se_num; i++) { si_select_se_sh(rdev, i, 0xffffffff); data = 0; diff --git a/sys/dev/pci/drm/radeon_drm.h b/sys/dev/pci/drm/radeon_drm.h index 535b7a22f1d..ff8c515e2ce 100644 --- a/sys/dev/pci/drm/radeon_drm.h +++ b/sys/dev/pci/drm/radeon_drm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_drm.h,v 1.10 2014/01/18 08:25:06 jsg Exp $ */ +/* $OpenBSD: radeon_drm.h,v 1.11 2014/02/10 01:59:47 jsg Exp $ */ /* radeon_drm.h -- Public header for the radeon driver -*- linux-c -*- * * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas. @@ -987,6 +987,8 @@ struct drm_radeon_cs { #define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17 /* CIK macrotile mode array */ #define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18 +/* query the number of render backends */ +#define RADEON_INFO_SI_BACKEND_ENABLED_MASK 0x19 struct drm_radeon_info { |