diff mbox series

[v1,04/11] drm/ati_pcigart: drop dependency on drm_os_linux.h

Message ID 20190718161507.2047-5-sam@ravnborg.org (mailing list archive)
State New, archived
Headers show
Series drm: header maintenance | expand

Commit Message

Sam Ravnborg July 18, 2019, 4:15 p.m. UTC
The drm_os_linux.h header is deprecated.
Just opencode the sole DRM_WRITE32().

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
---
 drivers/gpu/drm/ati_pcigart.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Sean Paul July 18, 2019, 5:49 p.m. UTC | #1
On Thu, Jul 18, 2019 at 06:15:00PM +0200, Sam Ravnborg wrote:
> The drm_os_linux.h header is deprecated.
> Just opencode the sole DRM_WRITE32().

Any plans for the other users of DRM_WRITE<N>()? It seems like it'd be trivial
to fix it up for via and mga. I don't really have any background on
drm_os_linux.h, but it doesn't seem like it'd be that much more effort to just
remove the whole thing.

Sean

> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Sean Paul <sean@poorly.run>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> ---
>  drivers/gpu/drm/ati_pcigart.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c
> index 2a413e291a60..580aa2676358 100644
> --- a/drivers/gpu/drm/ati_pcigart.c
> +++ b/drivers/gpu/drm/ati_pcigart.c
> @@ -35,7 +35,6 @@
>  
>  #include <drm/ati_pcigart.h>
>  #include <drm/drm_device.h>
> -#include <drm/drm_os_linux.h>
>  #include <drm/drm_pci.h>
>  #include <drm/drm_print.h>
>  
> @@ -169,6 +168,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
>  		page_base = (u32) entry->busaddr[i];
>  
>  		for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
> +			u32 offset;
>  			u32 val;
>  
>  			switch(gart_info->gart_reg_if) {
> @@ -184,10 +184,12 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
>  				break;
>  			}
>  			if (gart_info->gart_table_location ==
> -			    DRM_ATI_GART_MAIN)
> +			    DRM_ATI_GART_MAIN) {
>  				pci_gart[gart_idx] = cpu_to_le32(val);
> -			else
> -				DRM_WRITE32(map, gart_idx * sizeof(u32), val);
> +			} else {
> +				offset = gart_idx * sizeof(u32);
> +				writel(val, (void __iomem *)map->handle + offset);
> +			}
>  			gart_idx++;
>  			page_base += ATI_PCIGART_PAGE_SIZE;
>  		}
> -- 
> 2.20.1
>
Sam Ravnborg July 18, 2019, 6:11 p.m. UTC | #2
Hi Sean.
> 
> Any plans for the other users of DRM_WRITE<N>()? It seems like it'd be trivial
> to fix it up for via and mga. I don't really have any background on
> drm_os_linux.h, but it doesn't seem like it'd be that much more effort to just
> remove the whole thing.

During the drmP.h removal I also took care of drm_os_linux.h,
so when the patches land then there will be no users left.
I look forward to delete that file.

For via I only just posted the patches today.
For mga they already landed in drm-misc-next.

I expect that we after next merge window can delete
both drm_os_linux.h and drmP.h.

	Sam
Sean Paul July 18, 2019, 6:30 p.m. UTC | #3
On Thu, Jul 18, 2019 at 08:11:35PM +0200, Sam Ravnborg wrote:
> Hi Sean.
> > 
> > Any plans for the other users of DRM_WRITE<N>()? It seems like it'd be trivial
> > to fix it up for via and mga. I don't really have any background on
> > drm_os_linux.h, but it doesn't seem like it'd be that much more effort to just
> > remove the whole thing.
> 
> During the drmP.h removal I also took care of drm_os_linux.h,
> so when the patches land then there will be no users left.
> I look forward to delete that file.
> 
> For via I only just posted the patches today.
> For mga they already landed in drm-misc-next.
> 

Awesome! I think I was looking at drm-next instead of -misc-next, so happy to
hear the future is bright :)

Reviewed-by: Sean Paul <sean@poorly.run>


> I expect that we after next merge window can delete
> both drm_os_linux.h and drmP.h.
> 
> 	Sam
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c
index 2a413e291a60..580aa2676358 100644
--- a/drivers/gpu/drm/ati_pcigart.c
+++ b/drivers/gpu/drm/ati_pcigart.c
@@ -35,7 +35,6 @@ 
 
 #include <drm/ati_pcigart.h>
 #include <drm/drm_device.h>
-#include <drm/drm_os_linux.h>
 #include <drm/drm_pci.h>
 #include <drm/drm_print.h>
 
@@ -169,6 +168,7 @@  int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
 		page_base = (u32) entry->busaddr[i];
 
 		for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
+			u32 offset;
 			u32 val;
 
 			switch(gart_info->gart_reg_if) {
@@ -184,10 +184,12 @@  int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
 				break;
 			}
 			if (gart_info->gart_table_location ==
-			    DRM_ATI_GART_MAIN)
+			    DRM_ATI_GART_MAIN) {
 				pci_gart[gart_idx] = cpu_to_le32(val);
-			else
-				DRM_WRITE32(map, gart_idx * sizeof(u32), val);
+			} else {
+				offset = gart_idx * sizeof(u32);
+				writel(val, (void __iomem *)map->handle + offset);
+			}
 			gart_idx++;
 			page_base += ATI_PCIGART_PAGE_SIZE;
 		}