[PATCH] radeon: enable hawaii accel conditionally (v2)

Alex Deucher alexdeucher at gmail.com
Wed Jul 30 08:37:02 PDT 2014


On Tue, Jul 29, 2014 at 9:47 PM, Michel Dänzer <michel at daenzer.net> wrote:
> On 29.07.2014 23:34, Alex Deucher wrote:
>> Only if the kernel has the new CP firmware.
>>
>> v2: check value of ACCEL_WORKING2
>>
>> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
>> ---
>>  src/radeon_kms.c | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
>> index 707d0c7..c4cf876 100644
>> --- a/src/radeon_kms.c
>> +++ b/src/radeon_kms.c
>> @@ -400,8 +400,12 @@ static Bool RADEONIsAccelWorking(ScrnInfoPtr pScrn)
>>          }
>>          return FALSE;
>>      }
>> -    if (tmp)
>> +    if (info->ChipFamily == CHIP_FAMILY_HAWAII) {
>> +     if (tmp == 2)
>> +         return TRUE;
>
> I think this should be
>
>         if (tmp >= 2)
>
> or we can't use ACCEL_WORKING2 for any more such cases.

I think it should be fine.  The kernel only returns 2 for hawaii.  If
we find some other issue where we need to bump it again, we can return
3 and check for that in userspace.  Presumably if something similar
happens on other asics, we can treat them separately.

Alex

>
>
>> +    } else if (tmp) {
>>          return TRUE;
>> +    }
>>      return FALSE;
>>  }
>>
>> @@ -499,8 +503,7 @@ static Bool RADEONPreInitAccel_KMS(ScrnInfoPtr pScrn)
>>       info->is_fast_fb = TRUE;
>>      }
>>
>> -    if (!xf86ReturnOptValBool(info->Options, OPTION_ACCEL,
>> -                          info->ChipFamily != CHIP_FAMILY_HAWAII) ||
>> +    if (!xf86ReturnOptValBool(info->Options, OPTION_ACCEL, TRUE) ||
>>       (!RADEONIsAccelWorking(pScrn))) {
>>       xf86DrvMsg(pScrn->scrnIndex, X_INFO,
>>                  "GPU accel disabled or not working, using shadowfb for KMS\n");
>>
>
> Looks good to me other than that.
>
>
> --
> Earthling Michel Dänzer            |                  http://www.amd.com
> Libre software enthusiast          |                Mesa and X developer


More information about the xorg-driver-ati mailing list