/* Parse a PCI ID and fill an r300_capabilities struct with information. */
void r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps)
{
+ /* Reasonable defaults */
caps->pci_id = pci_id;
+ caps->has_tcl = TRUE;
+ caps->is_r500 = FALSE;
/* Note: These are not ordered by PCI ID. I leave that task to GCC,
* which will perform the ordering while collating jump tables. Instead,
case 0x4144:
caps->family = CHIP_FAMILY_R300;
caps->num_pipes = 1;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x4145:
case 0x4E47:
caps->family = CHIP_FAMILY_R300;
caps->num_pipes = 2;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x4150:
case 0x4E56:
caps->family = CHIP_FAMILY_RV350;
caps->num_pipes = 1;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x4148:
case 0x4E4B:
caps->family = CHIP_FAMILY_R350;
caps->num_pipes = 2;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x4E4A:
caps->family = CHIP_FAMILY_R360;
caps->num_pipes = 2;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x5460:
case 0x5B65:
caps->family = CHIP_FAMILY_RV370;
caps->num_pipes = 1;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x3150:
case 0x3E54:
caps->family = CHIP_FAMILY_RV380;
caps->num_pipes = 1;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x4A48:
case 0x4A54:
caps->family = CHIP_FAMILY_R420;
caps->num_pipes = 4;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x5548:
case 0x5D57:
caps->family = CHIP_FAMILY_R423;
caps->num_pipes = 4;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x554C:
case 0x5D4A:
caps->family = CHIP_FAMILY_R430;
caps->num_pipes = 4;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x5D4C:
case 0x5D52:
caps->family = CHIP_FAMILY_R480;
caps->num_pipes = 4;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x4B49:
case 0x4B4C:
caps->family = CHIP_FAMILY_R481;
caps->num_pipes = 4;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x5E4C:
case 0x5E4D:
caps->family = CHIP_FAMILY_RV410;
caps->num_pipes = 1;
- caps->has_tcl = TRUE;
- caps->has_us = FALSE;
break;
case 0x5954:
caps->family = CHIP_FAMILY_RS480;
caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
- caps->has_us = FALSE;
break;
case 0x5974:
caps->family = CHIP_FAMILY_RS482;
caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
- caps->has_us = FALSE;
break;
case 0x5A41:
caps->family = CHIP_FAMILY_RS400;
caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
- caps->has_us = FALSE;
break;
case 0x5A61:
caps->family = CHIP_FAMILY_RC410;
caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
- caps->has_us = FALSE;
break;
case 0x791E:
caps->family = CHIP_FAMILY_RS690;
caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
- caps->has_us = FALSE; /* CHECK ME */
break;
case 0x796C:
caps->family = CHIP_FAMILY_RS740;
caps->num_pipes = 1; /* CHECK ME */
caps->has_tcl = FALSE;
- caps->has_us = FALSE; /* CHECK ME */
break;
case 0x7100:
case 0x710F:
caps->family = CHIP_FAMILY_R520;
caps->num_pipes = 4;
- caps->has_tcl = TRUE;
- caps->has_us = TRUE;
+ caps->is_r500 = TRUE;
break;
case 0x7140:
case 0x7211:
caps->family = CHIP_FAMILY_RV515;
caps->num_pipes = 1;
- caps->has_tcl = TRUE;
- caps->has_us = TRUE;
+ caps->is_r500 = TRUE;
break;
case 0x71C0:
case 0x71DE:
caps->family = CHIP_FAMILY_RV530;
caps->num_pipes = 1;
- caps->has_tcl = TRUE;
- caps->has_us = TRUE;
+ caps->is_r500 = TRUE;
break;
case 0x7240:
case 0x7284:
caps->family = CHIP_FAMILY_R580;
caps->num_pipes = 4;
- caps->has_tcl = TRUE;
- caps->has_us = TRUE;
+ caps->is_r500 = TRUE;
break;
case 0x7280:
caps->family = CHIP_FAMILY_RV570;
caps->num_pipes = 4;
- caps->has_tcl = TRUE;
- caps->has_us = TRUE;
+ caps->is_r500 = TRUE;
break;
case 0x7281:
case 0x7297:
caps->family = CHIP_FAMILY_RV560;
caps->num_pipes = 4;
- caps->has_tcl = TRUE;
- caps->has_us = TRUE;
+ caps->is_r500 = TRUE;
break;
default:
/* XXX not an r300?! */
- assert(0);
break;
}
}
int num_pipes;
/* Whether or not TCL is physically present */
boolean has_tcl;
- /* Whether or not Universal Shaders (US) are used for fragment shaders */
- boolean has_us;
+ /* Whether or not this is an RV515 or newer; R500s have many features:
+ * - Extra bit on texture sizes
+ * - Blend color is split across two registers
+ * - Universal Shader (US) block used for fragment shaders */
+ boolean is_r500;
};
-/* Enumeration for legibility and also telling which card we're running on. */
+/* Enumerations for legibility and telling which card we're running on. */
enum {
CHIP_FAMILY_R300 = 0,
CHIP_FAMILY_R350,
if (r300->dirty_state & R300_NEW_BLEND_COLOR) {
struct r300_blend_color_state* blend_color = r300->blend_color_state;
- if (FALSE /*XXX*/) {
+ if (r300screen->caps->is_r500) {
/* XXX next two are contiguous regs */
OUT_CS_REG(R500_RB3D_CONSTANT_COLOR_AR,
blend_color->blend_color_red_alpha);
OUT_CS_REG(R300_ZB_ZSTENCILCNTL, dsa->z_stencil_control);
OUT_CS_REG(R300_ZB_STENCILREFMASK, dsa->stencil_ref_mask);
OUT_CS_REG(R300_ZB_ZTOP, dsa->z_buffer_top);
- if (FALSE /*XXX*/) {
+ if (r300screen->caps->is_r500) {
OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf);
}
}