2022-07-11 10:11:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.15 138/230] drm/amdgpu: bind to any 0x1002 PCI diplay class device

From: Alex Deucher <[email protected]>

[ Upstream commit eb4fd29afd4aa1c98d882800ceeee7d1f5262803 ]

Bind to all 0x1002 GPU devices.

For now we explicitly return -ENODEV for generic bindings.
Remove this check once IP discovery based checking is in place.

v2: rebase (Alex)

Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index f65b4b233ffb..c294081022bd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1952,6 +1952,16 @@ static const struct pci_device_id pciidlist[] = {
{0x1002, 0x7424, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
{0x1002, 0x743F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},

+ { PCI_DEVICE(0x1002, PCI_ANY_ID),
+ .class = PCI_CLASS_DISPLAY_VGA << 8,
+ .class_mask = 0xffffff,
+ .driver_data = 0 },
+
+ { PCI_DEVICE(0x1002, PCI_ANY_ID),
+ .class = PCI_CLASS_DISPLAY_OTHER << 8,
+ .class_mask = 0xffffff,
+ .driver_data = 0 },
+
{0, 0, 0}
};

@@ -1999,6 +2009,11 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
return -ENODEV;
}

+ if (flags == 0) {
+ DRM_INFO("Unsupported asic. Remove me when IP discovery init is in place.\n");
+ return -ENODEV;
+ }
+
if (amdgpu_virtual_display ||
amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
supports_atomic = true;
--
2.35.1




2022-07-11 10:25:35

by Christian König

[permalink] [raw]
Subject: Re: [PATCH 5.15 138/230] drm/amdgpu: bind to any 0x1002 PCI diplay class device

Hi Greg & Alex

why is that patch picked up for stable? Or are we backporting IP based
discovery?

If yes, is that wise? IIRC we had quite a number of typos etc.. in the
initial patches.

Regards,
Christian.

Am 11.07.22 um 11:06 schrieb Greg Kroah-Hartman:
> From: Alex Deucher <[email protected]>
>
> [ Upstream commit eb4fd29afd4aa1c98d882800ceeee7d1f5262803 ]
>
> Bind to all 0x1002 GPU devices.
>
> For now we explicitly return -ENODEV for generic bindings.
> Remove this check once IP discovery based checking is in place.
>
> v2: rebase (Alex)
>
> Reviewed-by: Christian König <[email protected]>
> Signed-off-by: Alex Deucher <[email protected]>
> Signed-off-by: Sasha Levin <[email protected]>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index f65b4b233ffb..c294081022bd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1952,6 +1952,16 @@ static const struct pci_device_id pciidlist[] = {
> {0x1002, 0x7424, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
> {0x1002, 0x743F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
>
> + { PCI_DEVICE(0x1002, PCI_ANY_ID),
> + .class = PCI_CLASS_DISPLAY_VGA << 8,
> + .class_mask = 0xffffff,
> + .driver_data = 0 },
> +
> + { PCI_DEVICE(0x1002, PCI_ANY_ID),
> + .class = PCI_CLASS_DISPLAY_OTHER << 8,
> + .class_mask = 0xffffff,
> + .driver_data = 0 },
> +
> {0, 0, 0}
> };
>
> @@ -1999,6 +2009,11 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> return -ENODEV;
> }
>
> + if (flags == 0) {
> + DRM_INFO("Unsupported asic. Remove me when IP discovery init is in place.\n");
> + return -ENODEV;
> + }
> +
> if (amdgpu_virtual_display ||
> amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
> supports_atomic = true;

2022-07-11 10:26:47

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 5.15 138/230] drm/amdgpu: bind to any 0x1002 PCI diplay class device

On Mon, Jul 11, 2022 at 11:29:53AM +0200, Christian K?nig wrote:
> Hi Greg & Alex
>
> why is that patch picked up for stable? Or are we backporting IP based
> discovery?

New device ids are usually added to stable trees as they are "trivial".

> If yes, is that wise? IIRC we had quite a number of typos etc.. in the
> initial patches.

If this commit is incorrect, we will be glad to drop it, or add any
needed add-on commits. Which do you want to see happen here?

thanks,

greg k-h

2022-07-11 10:44:16

by Christian König

[permalink] [raw]
Subject: Re: [PATCH 5.15 138/230] drm/amdgpu: bind to any 0x1002 PCI diplay class device

Am 11.07.22 um 11:37 schrieb Greg Kroah-Hartman:
> On Mon, Jul 11, 2022 at 11:29:53AM +0200, Christian König wrote:
>> Hi Greg & Alex
>>
>> why is that patch picked up for stable? Or are we backporting IP based
>> discovery?
> New device ids are usually added to stable trees as they are "trivial".

Ah! Ok, sounds like a misunderstanding.

For the background this is *not* a new device id, but rather changes the
way the existing device ids are discovered.

Instead of a table with device ids and hard coded list of hw blocks
inside a device, we now look at a VBIOS table to determine which hw
version/blocks are present.

So yes, this might enable new hardware but it's most likely not trivial
enough to be backported.

>> If yes, is that wise? IIRC we had quite a number of typos etc.. in the
>> initial patches.
> If this commit is incorrect, we will be glad to drop it, or add any
> needed add-on commits. Which do you want to see happen here?

Alex, that is mostly a question for you.

Thanks,
Christian.

>
> thanks,
>
> greg k-h

2022-07-11 14:38:15

by Deucher, Alexander

[permalink] [raw]
Subject: RE: [PATCH 5.15 138/230] drm/amdgpu: bind to any 0x1002 PCI diplay class device

[Public]

> -----Original Message-----
> From: Koenig, Christian <[email protected]>
> Sent: Monday, July 11, 2022 5:30 AM
> To: Greg Kroah-Hartman <[email protected]>; Deucher,
> Alexander <[email protected]>; [email protected]
> Cc: [email protected]; Sasha Levin <[email protected]>
> Subject: Re: [PATCH 5.15 138/230] drm/amdgpu: bind to any 0x1002 PCI
> diplay class device
>
> Hi Greg & Alex
>
> why is that patch picked up for stable? Or are we backporting IP based
> discovery?
>

Looks like Sasha picked it up. This should not go to stable.

Alex

> If yes, is that wise? IIRC we had quite a number of typos etc.. in the initial
> patches.
>
> Regards,
> Christian.
>
> Am 11.07.22 um 11:06 schrieb Greg Kroah-Hartman:
> > From: Alex Deucher <[email protected]>
> >
> > [ Upstream commit eb4fd29afd4aa1c98d882800ceeee7d1f5262803 ]
> >
> > Bind to all 0x1002 GPU devices.
> >
> > For now we explicitly return -ENODEV for generic bindings.
> > Remove this check once IP discovery based checking is in place.
> >
> > v2: rebase (Alex)
> >
> > Reviewed-by: Christian König <[email protected]>
> > Signed-off-by: Alex Deucher <[email protected]>
> > Signed-off-by: Sasha Levin <[email protected]>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > index f65b4b233ffb..c294081022bd 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > @@ -1952,6 +1952,16 @@ static const struct pci_device_id pciidlist[] = {
> > {0x1002, 0x7424, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
> > {0x1002, 0x743F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
> >
> > + { PCI_DEVICE(0x1002, PCI_ANY_ID),
> > + .class = PCI_CLASS_DISPLAY_VGA << 8,
> > + .class_mask = 0xffffff,
> > + .driver_data = 0 },
> > +
> > + { PCI_DEVICE(0x1002, PCI_ANY_ID),
> > + .class = PCI_CLASS_DISPLAY_OTHER << 8,
> > + .class_mask = 0xffffff,
> > + .driver_data = 0 },
> > +
> > {0, 0, 0}
> > };
> >
> > @@ -1999,6 +2009,11 @@ static int amdgpu_pci_probe(struct pci_dev
> *pdev,
> > return -ENODEV;
> > }
> >
> > + if (flags == 0) {
> > + DRM_INFO("Unsupported asic. Remove me when IP
> discovery init is in place.\n");
> > + return -ENODEV;
> > + }
> > +
> > if (amdgpu_virtual_display ||
> > amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
> > supports_atomic = true;

2022-07-11 14:58:47

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 5.15 138/230] drm/amdgpu: bind to any 0x1002 PCI diplay class device

On Mon, Jul 11, 2022 at 02:01:50PM +0000, Deucher, Alexander wrote:
> [Public]
>
> > -----Original Message-----
> > From: Koenig, Christian <[email protected]>
> > Sent: Monday, July 11, 2022 5:30 AM
> > To: Greg Kroah-Hartman <[email protected]>; Deucher,
> > Alexander <[email protected]>; [email protected]
> > Cc: [email protected]; Sasha Levin <[email protected]>
> > Subject: Re: [PATCH 5.15 138/230] drm/amdgpu: bind to any 0x1002 PCI
> > diplay class device
> >
> > Hi Greg & Alex
> >
> > why is that patch picked up for stable? Or are we backporting IP based
> > discovery?
> >
>
> Looks like Sasha picked it up. This should not go to stable.

Ok, will go and drop it now, thanks for letting us know.

greg k-h