drm/msm/mdp5: Use drm_device for creating gem address space
PATCH 1/1 drm/msm/mdp5: Use drm_device for creating gem address space
Creating the msm gem address space requires a reference to the dev where the iommu is located. The driver currently assumes this is the same as the platform device, which breaks when the iommu is outside of the platform device. Use the drm_device instead, which happens to always have a reference to the proper device.
--- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1 -1
@@ -702,7 +702,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)mdelay (16 );if (config->platform.iommu) { - aspace =msm_gem_address_space_create (&pdev->dev, + aspace =msm_gem_address_space_create (dev->dev, config->platform.iommu,"mdp5" );if (IS_ERR (aspace)) { ret =PTR_ERR (aspace);
Signature · 1 line
2.17.1
Quoted 17 lines · Jeffrey Hugo
Creating the msm gem address space requires a reference to the dev where the iommu is located. The driver currently assumes this is the same as the platform device, which breaks when the iommu is outside of the platform device. Use the
drm_deviceinstead, which happens to always have a reference to the proper device.Signed-off-by Jeffrey Hugo <[email protected]>--- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +0
-0
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c struct msm_kms *mdp5_kms_init(struct drm_device *dev) · line 706
Quoted 6 lines
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1
-1@@ -702,7 +702,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)mdelay (16 );if (config->platform.iommu) { - aspace =msm_gem_address_space_create (&pdev->dev, + aspace =msm_gem_address_space_create (dev->dev, config->platform.iommu,"mdp5" );
hmm, do you have a tree somewhere with your dt files? This makes me think the display iommu is hooked up somewhere differently compared to, say, msm8916.dtsi
BR,
-R
Quoted 5 lines
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +0
-1if (IS_ERR (aspace)) { ret =PTR_ERR (aspace); --2.17.1
Quoted 21 lines · Rob Clark
Quoted 19 lines · Jeffrey Hugo
Creating the msm gem address space requires a reference to the dev where the iommu is located. The driver currently assumes this is the same as the platform device, which breaks when the iommu is outside of the platform device. Use the
drm_deviceinstead, which happens to always have a reference to the proper device.Signed-off-by Jeffrey Hugo <[email protected]>--- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +0
-0@@ -702,7 +702,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)mdelay (16 );
Quoted 8 lines
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c struct msm_kms *mdp5_kms_init(struct drm_device *dev) · line 706
Quoted 4 lines
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1
-1if (config->platform.iommu) { - aspace =msm_gem_address_space_create (&pdev->dev, + aspace =msm_gem_address_space_create (dev->dev, config->platform.iommu,"mdp5" );hmm, do you have a tree somewhere with your dt files? This makes me think the display iommu is hooked up somewhere differently compared to, say,
msm8916.dtsi
I'll post something somewhere and forward it to you.
Quoted 7 lines · Jeffrey Hugo
Creating the msm gem address space requires a reference to the dev where the iommu is located. The driver currently assumes this is the same as the platform device, which breaks when the iommu is outside of the platform device. Use the
drm_deviceinstead, which happens to always have a reference to the proper device.Signed-off-by Jeffrey Hugo <[email protected]>
Sorry, but on db820c this patch results in:
[ 64.803263] msm_mdp 901000.mdp: [drm:mdp5_kms_init [msm]] *ERROR* failed to attach iommu: -19
Followed by 3 oopses as we're trying to fail the initialization.
Regards,
Bjorn
Quoted 20 lines
--- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1
-1@@ -702,7 +702,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)mdelay (16 );if (config->platform.iommu) { - aspace =msm_gem_address_space_create (&pdev->dev, + aspace =msm_gem_address_space_create (dev->dev, config->platform.iommu,"mdp5" );if (IS_ERR (aspace)) { ret =PTR_ERR (aspace);Signature · 1 line
2.17.1
Quoted 9 lines · Bjorn Andersson
Quoted 6 lines · Jeffrey Hugo
Creating the msm gem address space requires a reference to the dev where the iommu is located. The driver currently assumes this is the same as the platform device, which breaks when the iommu is outside of the platform device. Use the
drm_deviceinstead, which happens to always have a reference to the proper device.
Quoted 7 lines
Quoted 1 line
Signed-off-by Jeffrey Hugo <[email protected]>Sorry, but on db820c this patch results in:
[ 64.803263] msm_mdp 901000.mdp: [drm:mdp5_kms_init [msm]] *ERROR* failed to attach iommu: -19Followed by 3 oopses as we're trying to fail the initialization.
yeah, that is kinda what I suspected would happen. I guess to deal with how things are hooked up on 8998, perhaps the best thing is to first try &pdev->dev, and then if that fails try dev->dev
BR,
-R
Quoted 14 lines
Regards,
BjornQuoted 11 lines
--- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +0
-0@@ -702,7 +702,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)mdelay (16 );
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1
-2if (config->platform.iommu) { - aspace =msm_gem_address_space_create (&pdev->dev, + aspace =msm_gem_address_space_create (dev->dev, config->platform.iommu,"mdp5" );if (IS_ERR (aspace)) { ret =PTR_ERR (aspace); --2.17.1
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
Quoted 16 lines · Rob Clark
Quoted 13 lines · Bjorn Andersson
Quoted 7 lines · Jeffrey Hugo
Creating the msm gem address space requires a reference to the dev where the iommu is located. The driver currently assumes this is the same as the platform device, which breaks when the iommu is outside of the platform device. Use the
drm_deviceinstead, which happens to always have a reference to the proper device.Signed-off-by Jeffrey Hugo <[email protected]>Sorry, but on db820c this patch results in:
Quoted 7 lines
Quoted 3 lines
[ 64.803263] msm_mdp 901000.mdp: [drm:mdp5_kms_init [msm]] *ERROR* failed to attach iommu: -19Followed by 3 oopses as we're trying to fail the initialization.
yeah, that is kinda what I suspected would happen. I guess to deal with how things are hooked up on 8998, perhaps the best thing is to first try
&pdev->dev, and then if that fails trydev->dev
Thanks for the test feedback Bjorn. Its unfortunate this solution didn't work as I expected. I'll give Rob's suggestion a shot and spin another version.