summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/r300/r300_chipset.c39
-rw-r--r--src/gallium/drivers/r300/r300_chipset.h8
-rw-r--r--src/gallium/drivers/r300/r300_cs.h3
-rw-r--r--src/gallium/drivers/r300/r300_surface.c27
4 files changed, 31 insertions, 46 deletions
diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c
index 1dc9b8cf3c5..b7de2359cbd 100644
--- a/src/gallium/drivers/r300/r300_chipset.c
+++ b/src/gallium/drivers/r300/r300_chipset.c
@@ -32,6 +32,8 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
caps->pci_id = pci_id;
caps->has_tcl = TRUE;
caps->is_r500 = FALSE;
+ caps->num_vert_pipes = 4;
+
/* Note: These are not ordered by PCI ID. I leave that task to GCC,
* which will perform the ordering while collating jump tables. Instead,
@@ -39,7 +41,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
switch (pci_id) {
case 0x4144:
caps->family = CHIP_FAMILY_R300;
- caps->num_pipes = 1;
break;
case 0x4145:
@@ -50,7 +51,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x4E46:
case 0x4E47:
caps->family = CHIP_FAMILY_R300;
- caps->num_pipes = 2;
break;
case 0x4150:
@@ -67,7 +67,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x4E54:
case 0x4E56:
caps->family = CHIP_FAMILY_RV350;
- caps->num_pipes = 1;
break;
case 0x4148:
@@ -78,12 +77,10 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x4E49:
case 0x4E4B:
caps->family = CHIP_FAMILY_R350;
- caps->num_pipes = 2;
break;
case 0x4E4A:
caps->family = CHIP_FAMILY_R360;
- caps->num_pipes = 2;
break;
case 0x5460:
@@ -95,7 +92,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x5B64:
case 0x5B65:
caps->family = CHIP_FAMILY_RV370;
- caps->num_pipes = 1;
break;
case 0x3150:
@@ -104,7 +100,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x3E50:
case 0x3E54:
caps->family = CHIP_FAMILY_RV380;
- caps->num_pipes = 1;
break;
case 0x4A48:
@@ -118,7 +113,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x4A50:
case 0x4A54:
caps->family = CHIP_FAMILY_R420;
- caps->num_pipes = 4;
+ caps->num_vert_pipes = 6;
break;
case 0x5548:
@@ -131,7 +126,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x5554:
case 0x5D57:
caps->family = CHIP_FAMILY_R423;
- caps->num_pipes = 4;
+ caps->num_vert_pipes = 6;
break;
case 0x554C:
@@ -142,7 +137,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x5D49:
case 0x5D4A:
caps->family = CHIP_FAMILY_R430;
- caps->num_pipes = 4;
+ caps->num_vert_pipes = 6;
break;
case 0x5D4C:
@@ -152,7 +147,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x5D50:
case 0x5D52:
caps->family = CHIP_FAMILY_R480;
- caps->num_pipes = 4;
+ caps->num_vert_pipes = 6;
break;
case 0x4B49:
@@ -160,7 +155,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x4B4B:
case 0x4B4C:
caps->family = CHIP_FAMILY_R481;
- caps->num_pipes = 4;
+ caps->num_vert_pipes = 6;
break;
case 0x5E4C:
@@ -176,41 +171,36 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x5E4B:
case 0x5E4D:
caps->family = CHIP_FAMILY_RV410;
- caps->num_pipes = 1;
+ caps->num_vert_pipes = 6;
break;
case 0x5954:
case 0x5955:
caps->family = CHIP_FAMILY_RS480;
- caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
break;
case 0x5974:
case 0x5975:
caps->family = CHIP_FAMILY_RS482;
- caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
break;
case 0x5A41:
case 0x5A42:
caps->family = CHIP_FAMILY_RS400;
- caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
break;
case 0x5A61:
case 0x5A62:
caps->family = CHIP_FAMILY_RC410;
- caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
break;
case 0x791E:
case 0x791F:
caps->family = CHIP_FAMILY_RS690;
- caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
break;
@@ -219,7 +209,6 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x796E:
case 0x796F:
caps->family = CHIP_FAMILY_RS740;
- caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
break;
@@ -238,7 +227,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x710E:
case 0x710F:
caps->family = CHIP_FAMILY_R520;
- caps->num_pipes = 4;
+ caps->num_vert_pipes = 8;
caps->is_r500 = TRUE;
break;
@@ -281,7 +270,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x7210:
case 0x7211:
caps->family = CHIP_FAMILY_RV515;
- caps->num_pipes = 1;
+ caps->num_vert_pipes = 2;
caps->is_r500 = TRUE;
break;
@@ -302,7 +291,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x71DA:
case 0x71DE:
caps->family = CHIP_FAMILY_RV530;
- caps->num_pipes = 1;
+ caps->num_vert_pipes = 5;
caps->is_r500 = TRUE;
break;
@@ -322,13 +311,13 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x724F:
case 0x7284:
caps->family = CHIP_FAMILY_R580;
- caps->num_pipes = 4;
+ caps->num_vert_pipes = 8;
caps->is_r500 = TRUE;
break;
case 0x7280:
caps->family = CHIP_FAMILY_RV570;
- caps->num_pipes = 4;
+ caps->num_vert_pipes = 5;
caps->is_r500 = TRUE;
break;
@@ -344,7 +333,7 @@ void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
case 0x7293:
case 0x7297:
caps->family = CHIP_FAMILY_RV560;
- caps->num_pipes = 4;
+ caps->num_vert_pipes = 5;
caps->is_r500 = TRUE;
break;
diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h
index c2d7ad3414c..548d7a6c500 100644
--- a/src/gallium/drivers/r300/r300_chipset.h
+++ b/src/gallium/drivers/r300/r300_chipset.h
@@ -32,8 +32,10 @@ struct r300_capabilities {
uint32_t pci_id;
/* Chipset family */
int family;
- /* The number of Graphics Backend (GB) pipes */
- int num_pipes;
+ /* The number of vertex pipes */
+ int num_vert_pipes;
+ /* The number of fragment pipes */
+ int num_frag_pipes;
/* Whether or not TCL is physically present */
boolean has_tcl;
/* Whether or not this is an RV515 or newer; R500s have many features:
@@ -100,4 +102,4 @@ static const char* chip_families[] = {
void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps);
-#endif /* R300_CHIPSET_H */ \ No newline at end of file
+#endif /* R300_CHIPSET_H */
diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h
index 59ca985f40c..67cb5ee7d19 100644
--- a/src/gallium/drivers/r300/r300_cs.h
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -55,6 +55,9 @@ static uint32_t pack_float_32(float f)
#define CP_PACKET0(register, count) \
(RADEON_CP_PACKET0 | ((count) << 16) | ((register) >> 2))
+#define CP_PACKET3(op, count) \
+ (RADEON_CP_PACKET3 | (op) | ((count) << 16))
+
#define CS_LOCALS(context) \
struct r300_winsys* cs_winsys = context->winsys; \
struct radeon_cs* cs = cs_winsys->cs
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index 8a507d56e68..dd1c8862a73 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -30,10 +30,11 @@ static void r300_surface_fill(struct pipe_context* pipe,
unsigned w, unsigned h,
unsigned color)
{
- struct r300_context* context = r300_context(pipe);
- CS_LOCALS(context);
- boolean has_tcl = FALSE;
- boolean is_r500 = FALSE;
+ struct r300_context* r300 = r300_context(pipe);
+ CS_LOCALS(r300);
+ struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
+ boolean has_tcl = caps->has_tcl;
+ boolean is_r500 = caps->is_r500;
/* For the for loops. */
int i;
/* Emit a shitload of state, and then draw a point to clear the buffer.
@@ -224,20 +225,8 @@ static void r300_surface_fill(struct pipe_context* pipe,
(5 << R300_VF_MAX_VTX_NUM_SHIFT));
}
- if (CHIP_FAMILY_RV515)
- vap_cntl |= (2 << R300_PVS_NUM_FPUS_SHIFT);
- else if ((CHIP_FAMILY_RV530) ||
- (CHIP_FAMILY_RV560) ||
- (CHIP_FAMILY_RV570))
- vap_cntl |= (5 << R300_PVS_NUM_FPUS_SHIFT);
- else if ((CHIP_FAMILY_RV410) ||
- (CHIP_FAMILY_R420))
- vap_cntl |= (6 << R300_PVS_NUM_FPUS_SHIFT);
- else if ((CHIP_FAMILY_R520) ||
- (CHIP_FAMILY_R580))
- vap_cntl |= (8 << R300_PVS_NUM_FPUS_SHIFT);
- else
- vap_cntl |= (4 << R300_PVS_NUM_FPUS_SHIFT);
+ vap_cntl |= (caps->num_vert_pipes <<
+ R300_PVS_NUM_FPUS_SHIFT);
OUT_CS_REG(R300_VAP_CNTL, vap_cntl);
@@ -361,6 +350,8 @@ static void r300_surface_fill(struct pipe_context* pipe,
OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | (1 << 18));
FLUSH_CS;
+
+ r300->dirty_state = R300_NEW_KITCHEN_SINK;
}
void r300_init_surface_functions(struct r300_context* r300)