W dniu 18 lutego 2010 16:20 użytkownik Alex Deucher
<alexdeuc...@gmail.com> napisał:
> 2010/2/17 Rafał Miłecki <zaj...@gmail.com>:
>> Ported from DDX
>>
>> Signed-off-by: Rafał Miłecki <zaj...@gmail.com>
>> ---
>>  drivers/gpu/drm/radeon/r300.c        |    5 ++++-
>>  drivers/gpu/drm/radeon/radeon.h      |   14 ++++++++++++++
>>  drivers/gpu/drm/radeon/radeon_asic.h |    4 ++--
>>  drivers/gpu/drm/radeon/radeon_pm.c   |    2 ++
>>  4 files changed, 22 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
>> index 654aca1..cd92880 100644
>> --- a/drivers/gpu/drm/radeon/r300.c
>> +++ b/drivers/gpu/drm/radeon/r300.c
>> @@ -593,7 +593,10 @@ int rv370_get_pcie_lanes(struct radeon_device *rdev)
>>
>>        /* FIXME wait for idle */
>>
>> -       link_width_cntl = RREG32_PCIE(RADEON_PCIE_LC_LINK_WIDTH_CNTL);
>> +       if (rdev->family < CHIP_R600)
>> +               link_width_cntl = 
>> RREG32_PCIE(RADEON_PCIE_LC_LINK_WIDTH_CNTL);
>> +       else
>> +               link_width_cntl = 
>> RREG32_PCIE_P(RADEON_PCIE_LC_LINK_WIDTH_CNTL);
>>
>>        switch ((link_width_cntl & RADEON_PCIE_LC_LINK_WIDTH_RD_MASK) >> 
>> RADEON_PCIE_LC_LINK_WIDTH_RD_SHIFT) {
>>        case RADEON_PCIE_LC_LINK_WIDTH_X0:
>> diff --git a/drivers/gpu/drm/radeon/radeon.h 
>> b/drivers/gpu/drm/radeon/radeon.h
>> index b533411..db98924 100644
>> --- a/drivers/gpu/drm/radeon/radeon.h
>> +++ b/drivers/gpu/drm/radeon/radeon.h
>> @@ -1009,6 +1009,8 @@ static inline void r100_mm_wreg(struct radeon_device 
>> *rdev, uint32_t reg, uint32
>>  #define WREG32_MC(reg, v) rdev->mc_wreg(rdev, (reg), (v))
>>  #define RREG32_PCIE(reg) rv370_pcie_rreg(rdev, (reg))
>>  #define WREG32_PCIE(reg, v) rv370_pcie_wreg(rdev, (reg), (v))
>> +#define RREG32_PCIE_P(reg) r600_pcie_port_rreg(rdev, (reg))
>> +#define WREG32_PCIE_P(reg, v) r600_pcie_port_wreg(rdev, (reg), (v))
>>  #define WREG32_P(reg, val, mask)                               \
>>        do {                                                    \
>>                uint32_t tmp_ = RREG32(reg);                    \
>> @@ -1043,6 +1045,18 @@ static inline void rv370_pcie_wreg(struct 
>> radeon_device *rdev, uint32_t reg, uin
>>        WREG32(RADEON_PCIE_DATA, (v));
>>  }
>>
>> +static inline uint32_t r600_pcie_port_rreg(struct radeon_device *rdev, 
>> uint32_t reg)
>> +{
>> +       WREG32(R600_PCIE_PORT_INDEX, ((reg) & rdev->pcie_reg_mask));
>> +       return RREG32(R600_PCIE_PORT_DATA);
>> +}
>> +
>> +static inline void r600_pcie_port_wreg(struct radeon_device *rdev, uint32_t 
>> reg, uint32_t v)
>> +{
>> +       WREG32(R600_PCIE_PORT_INDEX, ((reg) & rdev->pcie_reg_mask));
>> +       WREG32(R600_PCIE_PORT_DATA, (v));
>> +}
>> +
>
> These already exist in r600.c:
> r600_pciep_rreg
> r600_pciep_wreg

Oh, didn't notice that because it uses duplicated definition:
./r600d.h:#define       PCIE_PORT_INDEX                                 0x0038
./r600_reg.h:#define R600_PCIE_PORT_INDEX                0x0038

-- 
Rafał

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to