Date:2010-02-21 21:24:15 (12 years 7 months ago)
Author:Marek Olšák
Commit:cae94b0ad9d147152af77b971a7234faf20027a9
Message:drm/radeon/kms: allow R500 regs VAP_ALT_NUM_VERTICES and VAP_INDEX_OFFSET

[airlied: fix V_A_N_V to not be safe and fix check to make sure only r500
- bump userspace version]

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Files: drivers/gpu/drm/radeon/r100.c (1 diff)
drivers/gpu/drm/radeon/r100_track.h (1 diff)
drivers/gpu/drm/radeon/r300.c (3 diffs)
drivers/gpu/drm/radeon/radeon_drv.c (1 diff)
drivers/gpu/drm/radeon/reg_srcs/rv515 (1 diff)

Change Details

drivers/gpu/drm/radeon/r100.c
30113011        }
30123012    }
30133013    prim_walk = (track->vap_vf_cntl >> 4) & 0x3;
3014    nverts = (track->vap_vf_cntl >> 16) & 0xFFFF;
3014    if (track->vap_vf_cntl & (1 << 14)) {
3015        nverts = track->vap_alt_nverts;
3016    } else {
3017        nverts = (track->vap_vf_cntl >> 16) & 0xFFFF;
3018    }
30153019    switch (prim_walk) {
30163020    case 1:
30173021        for (i = 0; i < track->num_arrays; i++) {
drivers/gpu/drm/radeon/r100_track.h
6464    unsigned maxy;
6565    unsigned vtx_size;
6666    unsigned vap_vf_cntl;
67    unsigned vap_alt_nverts;
6768    unsigned immd_dwords;
6869    unsigned num_arrays;
6970    unsigned max_indx;
drivers/gpu/drm/radeon/r300.c
729729        /* VAP_VF_MAX_VTX_INDX */
730730        track->max_indx = idx_value & 0x00FFFFFFUL;
731731        break;
732    case 0x2088:
733        /* VAP_ALT_NUM_VERTICES - only valid on r500 */
734        if (p->rdev->family < CHIP_RV515)
735            goto fail;
736        track->vap_alt_nverts = idx_value & 0xFFFFFF;
737        break;
732738    case 0x43E4:
733739        /* SC_SCISSOR1 */
734740        track->maxy = ((idx_value >> 13) & 0x1FFF) + 1;
...... 
766772        tmp = idx_value & ~(0x7 << 16);
767773        tmp |= tile_flags;
768774        ib[idx] = tmp;
769
770775        i = (reg - 0x4E38) >> 2;
771776        track->cb[i].pitch = idx_value & 0x3FFE;
772777        switch (((idx_value >> 21) & 0xF)) {
...... 
10511056            break;
10521057        /* fallthrough do not move */
10531058    default:
1054        printk(KERN_ERR "Forbidden register 0x%04X in cs at %d\n",
1055               reg, idx);
1056        return -EINVAL;
1059        goto fail;
10571060    }
10581061    return 0;
1062fail:
1063    printk(KERN_ERR "Forbidden register 0x%04X in cs at %d\n",
1064           reg, idx);
1065    return -EINVAL;
10591066}
10601067
10611068static int r300_packet3_check(struct radeon_cs_parser *p,
drivers/gpu/drm/radeon/radeon_drv.c
4343 * - 2.0.0 - initial interface
4444 * - 2.1.0 - add square tiling interface
4545 * - 2.2.0 - add r6xx/r7xx const buffer support
46 * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs
4647 */
4748#define KMS_DRIVER_MAJOR 2
48#define KMS_DRIVER_MINOR 2
49#define KMS_DRIVER_MINOR 3
4950#define KMS_DRIVER_PATCHLEVEL 0
5051int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
5152int radeon_driver_unload_kms(struct drm_device *dev);
drivers/gpu/drm/radeon/reg_srcs/rv515
35350x1DA8 VAP_VPORT_ZSCALE
36360x1DAC VAP_VPORT_ZOFFSET
37370x2080 VAP_CNTL
380x208C VAP_INDEX_OFFSET
38390x2090 VAP_OUT_VTX_FMT_0
39400x2094 VAP_OUT_VTX_FMT_1
40410x20B0 VAP_VTE_CNTL

Archive Download the corresponding diff file



interactive