summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon
diff options
context:
space:
mode:
authorPauli Nieminen <suokkos@gmail.com>2009-08-25 02:36:13 +0300
committerPauli Nieminen <suokkos@gmail.com>2009-08-25 02:36:13 +0300
commitce7ed63f0c2f5cb1c030f73a5d8f6544eaac0f81 (patch)
tree7554a2723fabb39037101724e5f179b70bb5a948 /src/mesa/drivers/dri/radeon
parent4297f32c246cc5b726d02745456c06952322958d (diff)
parent1d5a06a1f7812c055db1d724e40d21a0e3686dd1 (diff)
Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into r600_state_predict
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h8
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_fbo.c3
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c18
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.h1
4 files changed, 29 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h b/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h
index a42870f4a9..4520a7d7d4 100644
--- a/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h
+++ b/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h
@@ -45,6 +45,10 @@ struct drm_radeon_info {
#define RADEON_PARAM_DEVICE_ID 16
#endif
+#ifndef RADEON_PARAM_NUM_Z_PIPES
+#define RADEON_PARAM_NUM_Z_PIPES 17
+#endif
+
#ifndef RADEON_INFO_DEVICE_ID
#define RADEON_INFO_DEVICE_ID 0
#endif
@@ -52,6 +56,10 @@ struct drm_radeon_info {
#define RADEON_INFO_NUM_GB_PIPES 0
#endif
+#ifndef RADEON_INFO_NUM_Z_PIPES
+#define RADEON_INFO_NUM_Z_PIPES 0
+#endif
+
#ifndef DRM_RADEON_INFO
#define DRM_RADEON_INFO 0x1
#endif
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 3d7c9708e1..6f0cc08770 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -178,12 +178,13 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
width, height);
}
else {
- uint32_t size = width * height * cpp;
+ uint32_t size;
uint32_t pitch = ((cpp * width + 63) & ~63) / cpp;
fprintf(stderr,"Allocating %d x %d radeon RBO (pitch %d)\n", width,
height, pitch);
+ size = pitch * height * cpp;
rrb->pitch = pitch * cpp;
rrb->cpp = cpp;
rrb->bo = radeon_bo_open(radeon->radeonScreen->bom,
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 10afe527d3..bdcfd10c06 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -267,6 +267,9 @@ radeonGetParam(__DRIscreenPrivate *sPriv, int param, void *value)
case RADEON_PARAM_NUM_GB_PIPES:
info.request = RADEON_INFO_NUM_GB_PIPES;
break;
+ case RADEON_PARAM_NUM_Z_PIPES:
+ info.request = RADEON_INFO_NUM_Z_PIPES;
+ break;
default:
return -EINVAL;
}
@@ -1171,6 +1174,15 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
default:
break;
}
+
+ if ( sPriv->drm_version.minor >= 31 ) {
+ ret = radeonGetParam(sPriv, RADEON_PARAM_NUM_Z_PIPES, &temp);
+ if (ret)
+ screen->num_z_pipes = 2;
+ else
+ screen->num_z_pipes = temp;
+ } else
+ screen->num_z_pipes = 2;
}
if ( sPriv->drm_version.minor >= 10 ) {
@@ -1372,6 +1384,12 @@ radeonCreateScreen2(__DRIscreenPrivate *sPriv)
break;
}
+ ret = radeonGetParam(sPriv, RADEON_PARAM_NUM_Z_PIPES, &temp);
+ if (ret)
+ screen->num_z_pipes = 2;
+ else
+ screen->num_z_pipes = temp;
+
}
i = 0;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h
index f0dd46b0b1..15744e8828 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.h
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.h
@@ -108,6 +108,7 @@ typedef struct radeon_screen {
const __DRIextension *extensions[16];
int num_gb_pipes;
+ int num_z_pipes;
int kernel_mm;
drm_radeon_sarea_t *sarea; /* Private SAREA data */
struct radeon_bo_manager *bom;