diff mbox

drm/radeon/kms: fix mac g5 quirk

Message ID 1307379210-9213-1-git-send-email-alexdeucher@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Alex Deucher June 6, 2011, 4:53 p.m. UTC
Apple uses the same subsystem pci ids for lots of
hardware much of which is wired up differently.  In
this case, the G5 imac and the G5 tower.

Only apply the quirk configuration to G5 towers.

Reported-by: Joachim Henke <j-o@users.sourceforge.net>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Joachim Henke <j-o@users.sourceforge.net>
Cc: Michel Dänzer <michel@daenzer.net>
---
 drivers/gpu/drm/radeon/radeon_combios.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

Comments

Michel Dänzer June 14, 2011, 6:39 a.m. UTC | #1
On Mon, 2011-06-06 at 12:53 -0400, Alex Deucher wrote: 
> Apple uses the same subsystem pci ids for lots of
> hardware much of which is wired up differently.  In
> this case, the G5 imac and the G5 tower.
> 
> Only apply the quirk configuration to G5 towers.
> 
> Reported-by: Joachim Henke <j-o@users.sourceforge.net>
> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> Cc: Joachim Henke <j-o@users.sourceforge.net>
> Cc: Michel Dänzer <michel@daenzer.net>
> ---
>  drivers/gpu/drm/radeon/radeon_combios.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
> index 5b991f7..19b10cf 100644
> --- a/drivers/gpu/drm/radeon/radeon_combios.c
> +++ b/drivers/gpu/drm/radeon/radeon_combios.c
> @@ -1548,9 +1548,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
>  			   (rdev->pdev->subsystem_device == 0x4a48)) {
>  			/* Mac X800 */
>  			rdev->mode_info.connector_table = CT_MAC_X800;
> -		} else if ((rdev->pdev->device == 0x4150) &&
> -			   (rdev->pdev->subsystem_vendor == 0x1002) &&
> -			   (rdev->pdev->subsystem_device == 0x4150)) {
> +		} else if (of_machine_is_compatible("PowerMac7,2") ||
> +			   of_machine_is_compatible("PowerMac7,3")) {
>  			/* Mac G5 9600 */
>  			rdev->mode_info.connector_table = CT_MAC_G5_9600;
>  		} else

I think this still needs to check the PCI IDs as well, or it would break
different cards in these machines?
Alex Deucher June 14, 2011, 6:48 a.m. UTC | #2
2011/6/14 Michel Dänzer <michel@daenzer.net>:
> On Mon, 2011-06-06 at 12:53 -0400, Alex Deucher wrote:
>> Apple uses the same subsystem pci ids for lots of
>> hardware much of which is wired up differently.  In
>> this case, the G5 imac and the G5 tower.
>>
>> Only apply the quirk configuration to G5 towers.
>>
>> Reported-by: Joachim Henke <j-o@users.sourceforge.net>
>> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
>> Cc: Joachim Henke <j-o@users.sourceforge.net>
>> Cc: Michel Dänzer <michel@daenzer.net>
>> ---
>>  drivers/gpu/drm/radeon/radeon_combios.c |    5 ++---
>>  1 files changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
>> index 5b991f7..19b10cf 100644
>> --- a/drivers/gpu/drm/radeon/radeon_combios.c
>> +++ b/drivers/gpu/drm/radeon/radeon_combios.c
>> @@ -1548,9 +1548,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
>>                          (rdev->pdev->subsystem_device == 0x4a48)) {
>>                       /* Mac X800 */
>>                       rdev->mode_info.connector_table = CT_MAC_X800;
>> -             } else if ((rdev->pdev->device == 0x4150) &&
>> -                        (rdev->pdev->subsystem_vendor == 0x1002) &&
>> -                        (rdev->pdev->subsystem_device == 0x4150)) {
>> +             } else if (of_machine_is_compatible("PowerMac7,2") ||
>> +                        of_machine_is_compatible("PowerMac7,3")) {
>>                       /* Mac G5 9600 */
>>                       rdev->mode_info.connector_table = CT_MAC_G5_9600;
>>               } else
>
> I think this still needs to check the PCI IDs as well, or it would break
> different cards in these machines?

I don't know which (if any) other cards apple offered for these
machines.  I suppose it wouldn't hurt, but OTOH, if this card is all
that was offered, it's probably not that big a deal as it would be
unlikely that another card with a mac vbios would show up in one.
Cards with an x86 vbios won't hit this path.

Alex
Michel Dänzer June 14, 2011, 6:57 a.m. UTC | #3
On Die, 2011-06-14 at 02:48 -0400, Alex Deucher wrote: 
> 2011/6/14 Michel Dänzer <michel@daenzer.net>:
> > On Mon, 2011-06-06 at 12:53 -0400, Alex Deucher wrote:
> >> Apple uses the same subsystem pci ids for lots of
> >> hardware much of which is wired up differently.  In
> >> this case, the G5 imac and the G5 tower.
> >>
> >> Only apply the quirk configuration to G5 towers.
> >>
> >> Reported-by: Joachim Henke <j-o@users.sourceforge.net>
> >> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> >> Cc: Joachim Henke <j-o@users.sourceforge.net>
> >> Cc: Michel Dänzer <michel@daenzer.net>
> >> ---
> >>  drivers/gpu/drm/radeon/radeon_combios.c |    5 ++---
> >>  1 files changed, 2 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
> >> index 5b991f7..19b10cf 100644
> >> --- a/drivers/gpu/drm/radeon/radeon_combios.c
> >> +++ b/drivers/gpu/drm/radeon/radeon_combios.c
> >> @@ -1548,9 +1548,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
> >>                          (rdev->pdev->subsystem_device == 0x4a48)) {
> >>                       /* Mac X800 */
> >>                       rdev->mode_info.connector_table = CT_MAC_X800;
> >> -             } else if ((rdev->pdev->device == 0x4150) &&
> >> -                        (rdev->pdev->subsystem_vendor == 0x1002) &&
> >> -                        (rdev->pdev->subsystem_device == 0x4150)) {
> >> +             } else if (of_machine_is_compatible("PowerMac7,2") ||
> >> +                        of_machine_is_compatible("PowerMac7,3")) {
> >>                       /* Mac G5 9600 */
> >>                       rdev->mode_info.connector_table = CT_MAC_G5_9600;
> >>               } else
> >
> > I think this still needs to check the PCI IDs as well, or it would break
> > different cards in these machines?
> 
> I don't know which (if any) other cards apple offered for these
> machines.  I suppose it wouldn't hurt, but OTOH, if this card is all
> that was offered, it's probably not that big a deal as it would be
> unlikely that another card with a mac vbios would show up in one.
> Cards with an x86 vbios won't hit this path.

Ah right, I didn't think of that, and it looks like the X800 is already
covered as well. Still, as you say, it probably wouldn't hurt. :)
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index 5b991f7..19b10cf 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -1548,9 +1548,8 @@  bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
 			   (rdev->pdev->subsystem_device == 0x4a48)) {
 			/* Mac X800 */
 			rdev->mode_info.connector_table = CT_MAC_X800;
-		} else if ((rdev->pdev->device == 0x4150) &&
-			   (rdev->pdev->subsystem_vendor == 0x1002) &&
-			   (rdev->pdev->subsystem_device == 0x4150)) {
+		} else if (of_machine_is_compatible("PowerMac7,2") ||
+			   of_machine_is_compatible("PowerMac7,3")) {
 			/* Mac G5 9600 */
 			rdev->mode_info.connector_table = CT_MAC_G5_9600;
 		} else