[02/10] drm/amdkfd: add renoir kfd device info

Submitted by Huang, Ray on Sept. 4, 2019, 3:48 p.m.

Details

Message ID 20190904154803.5102-3-ray.huang@amd.com
State New
Headers show
Series "drm/amdkfd: introduce the kfd support for Renoir" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Huang, Ray Sept. 4, 2019, 3:48 p.m.
This patch inits renoir kfd device info, so we treat renoir as "dgpu"
(bypass iommu v2). Will enable needs_iommu_device till renoir iommu is ready.

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 2514263..1f65585 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -317,6 +317,23 @@  static const struct kfd_device_info vega20_device_info = {
 	.num_sdma_queues_per_engine = 8,
 };
 
+static const struct kfd_device_info renoir_device_info = {
+	.asic_family = CHIP_RENOIR,
+	.max_pasid_bits = 16,
+	.max_no_of_hqd  = 24,
+	.doorbell_size  = 8,
+	.ih_ring_entry_size = 8 * sizeof(uint32_t),
+	.event_interrupt_class = &event_interrupt_class_v9,
+	.num_of_watch_points = 4,
+	.mqd_size_aligned = MQD_SIZE_ALIGNED,
+	.supports_cwsr = true,
+	.needs_iommu_device = false,
+	.needs_pci_atomics = false,
+	.num_sdma_engines = 1,
+	.num_xgmi_sdma_engines = 0,
+	.num_sdma_queues_per_engine = 2,
+};
+
 static const struct kfd_device_info navi10_device_info = {
 	.asic_family = CHIP_NAVI10,
 	.max_pasid_bits = 16,
@@ -452,6 +469,8 @@  static const struct kfd_deviceid supported_devices[] = {
 	{ 0x66a4, &vega20_device_info },	/* Vega20 */
 	{ 0x66a7, &vega20_device_info },	/* Vega20 */
 	{ 0x66af, &vega20_device_info },	/* Vega20 */
+	/* Renoir */
+	{ 0x1636, &renoir_device_info },	/* Renoir */
 	/* Navi10 */
 	{ 0x7310, &navi10_device_info },	/* Navi10 */
 	{ 0x7312, &navi10_device_info },	/* Navi10 */

Comments

On 2019-09-04 11:48 a.m., Huang, Ray wrote:
> This patch inits renoir kfd device info, so we treat renoir as "dgpu"

> (bypass iommu v2). Will enable needs_iommu_device till renoir iommu is ready.

>

> Signed-off-by: Huang Rui <ray.huang@amd.com>


Looks good, but please coordinate with Yong who is changing the 
structure of the kfd device info table. See his patch "drm/amdkfd: Query 
kfd device info by CHIP id instead of pci device id" for details. 
Whoever goes in second will need to rebase and fix the conflict.

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>



> ---

>   drivers/gpu/drm/amd/amdkfd/kfd_device.c | 19 +++++++++++++++++++

>   1 file changed, 19 insertions(+)

>

> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c

> index 2514263..1f65585 100644

> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c

> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c

> @@ -317,6 +317,23 @@ static const struct kfd_device_info vega20_device_info = {

>   	.num_sdma_queues_per_engine = 8,

>   };

>   

> +static const struct kfd_device_info renoir_device_info = {

> +	.asic_family = CHIP_RENOIR,

> +	.max_pasid_bits = 16,

> +	.max_no_of_hqd  = 24,

> +	.doorbell_size  = 8,

> +	.ih_ring_entry_size = 8 * sizeof(uint32_t),

> +	.event_interrupt_class = &event_interrupt_class_v9,

> +	.num_of_watch_points = 4,

> +	.mqd_size_aligned = MQD_SIZE_ALIGNED,

> +	.supports_cwsr = true,

> +	.needs_iommu_device = false,

> +	.needs_pci_atomics = false,

> +	.num_sdma_engines = 1,

> +	.num_xgmi_sdma_engines = 0,

> +	.num_sdma_queues_per_engine = 2,

> +};

> +

>   static const struct kfd_device_info navi10_device_info = {

>   	.asic_family = CHIP_NAVI10,

>   	.max_pasid_bits = 16,

> @@ -452,6 +469,8 @@ static const struct kfd_deviceid supported_devices[] = {

>   	{ 0x66a4, &vega20_device_info },	/* Vega20 */

>   	{ 0x66a7, &vega20_device_info },	/* Vega20 */

>   	{ 0x66af, &vega20_device_info },	/* Vega20 */

> +	/* Renoir */

> +	{ 0x1636, &renoir_device_info },	/* Renoir */

>   	/* Navi10 */

>   	{ 0x7310, &navi10_device_info },	/* Navi10 */

>   	{ 0x7312, &navi10_device_info },	/* Navi10 */
On Thu, Sep 05, 2019 at 03:38:31AM +0800, Kuehling, Felix wrote:
> On 2019-09-04 11:48 a.m., Huang, Ray wrote:
> > This patch inits renoir kfd device info, so we treat renoir as "dgpu"
> > (bypass iommu v2). Will enable needs_iommu_device till renoir iommu is ready.
> >
> > Signed-off-by: Huang Rui <ray.huang@amd.com>
> 
> Looks good, but please coordinate with Yong who is changing the 
> structure of the kfd device info table. See his patch "drm/amdkfd: Query 
> kfd device info by CHIP id instead of pci device id" for details. 
> Whoever goes in second will need to rebase and fix the conflict.

Talked with Yong, he has submitted the patch to drm-next.
I will rebase the patch.

Thanks,
Ray

> 
> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
> 
> 
> > ---
> >   drivers/gpu/drm/amd/amdkfd/kfd_device.c | 19 +++++++++++++++++++
> >   1 file changed, 19 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> > index 2514263..1f65585 100644
> > --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> > @@ -317,6 +317,23 @@ static const struct kfd_device_info vega20_device_info = {
> >   	.num_sdma_queues_per_engine = 8,
> >   };
> >   
> > +static const struct kfd_device_info renoir_device_info = {
> > +	.asic_family = CHIP_RENOIR,
> > +	.max_pasid_bits = 16,
> > +	.max_no_of_hqd  = 24,
> > +	.doorbell_size  = 8,
> > +	.ih_ring_entry_size = 8 * sizeof(uint32_t),
> > +	.event_interrupt_class = &event_interrupt_class_v9,
> > +	.num_of_watch_points = 4,
> > +	.mqd_size_aligned = MQD_SIZE_ALIGNED,
> > +	.supports_cwsr = true,
> > +	.needs_iommu_device = false,
> > +	.needs_pci_atomics = false,
> > +	.num_sdma_engines = 1,
> > +	.num_xgmi_sdma_engines = 0,
> > +	.num_sdma_queues_per_engine = 2,
> > +};
> > +
> >   static const struct kfd_device_info navi10_device_info = {
> >   	.asic_family = CHIP_NAVI10,
> >   	.max_pasid_bits = 16,
> > @@ -452,6 +469,8 @@ static const struct kfd_deviceid supported_devices[] = {
> >   	{ 0x66a4, &vega20_device_info },	/* Vega20 */
> >   	{ 0x66a7, &vega20_device_info },	/* Vega20 */
> >   	{ 0x66af, &vega20_device_info },	/* Vega20 */
> > +	/* Renoir */
> > +	{ 0x1636, &renoir_device_info },	/* Renoir */
> >   	/* Navi10 */
> >   	{ 0x7310, &navi10_device_info },	/* Navi10 */
> >   	{ 0x7312, &navi10_device_info },	/* Navi10 */