All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] drm/savage: drop use of drmP.h
@ 2019-06-05 14:03 Sam Ravnborg
  2019-06-05 14:03 ` [PATCH v1 1/2] drm/savage: drop use of drm_os_linux Sam Ravnborg
  2019-06-05 14:03 ` [PATCH v1 2/2] drm/savage: drop use of drmP.h Sam Ravnborg
  0 siblings, 2 replies; 5+ messages in thread
From: Sam Ravnborg @ 2019-06-05 14:03 UTC (permalink / raw)
  To: dri-devel; +Cc: David Airlie

Drop use of the deprecated drmP.h header file.
And likewise drop use of macros from drm_os_linux.h

	Sam


Sam Ravnborg (2):
      drm/savage: drop use of drm_os_linux
      drm/savage: drop use of drmP.h

 drivers/gpu/drm/savage/savage_bci.c   | 25 +++++++++++++++++--------
 drivers/gpu/drm/savage/savage_drv.c   |  9 +++++----
 drivers/gpu/drm/savage/savage_drv.h   | 10 ++++++++--
 drivers/gpu/drm/savage/savage_state.c |  9 ++++++++-
 4 files changed, 38 insertions(+), 15 deletions(-)


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 1/2] drm/savage: drop use of drm_os_linux
  2019-06-05 14:03 [PATCH v1 0/2] drm/savage: drop use of drmP.h Sam Ravnborg
@ 2019-06-05 14:03 ` Sam Ravnborg
  2019-06-05 14:03 ` [PATCH v1 2/2] drm/savage: drop use of drmP.h Sam Ravnborg
  1 sibling, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2019-06-05 14:03 UTC (permalink / raw)
  To: dri-devel; +Cc: David Airlie, Sam Ravnborg

Drop use of macros from the deprecated drm_os_linux header.
Simple 1:1 replacements of
- DRM_UDELAY
- DRM_CURRENTPID
- DRM_READ
- DRM_WRITE

With this change we do not need to introduce the deprecated
drm_os_linux.h header when we drop use of drmP.h.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
---
 drivers/gpu/drm/savage/savage_bci.c | 17 ++++++++++-------
 drivers/gpu/drm/savage/savage_drv.h |  6 ++++--
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/savage/savage_bci.c b/drivers/gpu/drm/savage/savage_bci.c
index 35dc74883f83..aa00cf117433 100644
--- a/drivers/gpu/drm/savage/savage_bci.c
+++ b/drivers/gpu/drm/savage/savage_bci.c
@@ -22,6 +22,9 @@
  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
+
+#include <linux/delay.h>
+
 #include <drm/drmP.h>
 #include <drm/savage_drm.h>
 #include "savage_drv.h"
@@ -53,7 +56,7 @@ savage_bci_wait_fifo_shadow(drm_savage_private_t * dev_priv, unsigned int n)
 		status = dev_priv->status_ptr[0];
 		if ((status & mask) < threshold)
 			return 0;
-		DRM_UDELAY(1);
+		udelay(1);
 	}
 
 #if SAVAGE_BCI_DEBUG
@@ -74,7 +77,7 @@ savage_bci_wait_fifo_s3d(drm_savage_private_t * dev_priv, unsigned int n)
 		status = SAVAGE_READ(SAVAGE_STATUS_WORD0);
 		if ((status & SAVAGE_FIFO_USED_MASK_S3D) <= maxUsed)
 			return 0;
-		DRM_UDELAY(1);
+		udelay(1);
 	}
 
 #if SAVAGE_BCI_DEBUG
@@ -95,7 +98,7 @@ savage_bci_wait_fifo_s4(drm_savage_private_t * dev_priv, unsigned int n)
 		status = SAVAGE_READ(SAVAGE_ALT_STATUS_WORD0);
 		if ((status & SAVAGE_FIFO_USED_MASK_S4) <= maxUsed)
 			return 0;
-		DRM_UDELAY(1);
+		udelay(1);
 	}
 
 #if SAVAGE_BCI_DEBUG
@@ -128,7 +131,7 @@ savage_bci_wait_event_shadow(drm_savage_private_t * dev_priv, uint16_t e)
 		if ((((status & 0xffff) - e) & 0xffff) <= 0x7fff ||
 		    (status & 0xffff) == 0)
 			return 0;
-		DRM_UDELAY(1);
+		udelay(1);
 	}
 
 #if SAVAGE_BCI_DEBUG
@@ -150,7 +153,7 @@ savage_bci_wait_event_reg(drm_savage_private_t * dev_priv, uint16_t e)
 		if ((((status & 0xffff) - e) & 0xffff) <= 0x7fff ||
 		    (status & 0xffff) == 0)
 			return 0;
-		DRM_UDELAY(1);
+		udelay(1);
 	}
 
 #if SAVAGE_BCI_DEBUG
@@ -1014,7 +1017,7 @@ int savage_bci_buffers(struct drm_device *dev, void *data, struct drm_file *file
 	 */
 	if (d->send_count != 0) {
 		DRM_ERROR("Process %d trying to send %d buffers via drmDMA\n",
-			  DRM_CURRENTPID, d->send_count);
+			  task_pid_nr(current), d->send_count);
 		return -EINVAL;
 	}
 
@@ -1022,7 +1025,7 @@ int savage_bci_buffers(struct drm_device *dev, void *data, struct drm_file *file
 	 */
 	if (d->request_count < 0 || d->request_count > dma->buf_count) {
 		DRM_ERROR("Process %d trying to get %d buffers (of %d max)\n",
-			  DRM_CURRENTPID, d->request_count, dma->buf_count);
+			  task_pid_nr(current), d->request_count, dma->buf_count);
 		return -EINVAL;
 	}
 
diff --git a/drivers/gpu/drm/savage/savage_drv.h b/drivers/gpu/drm/savage/savage_drv.h
index 44a1009b6ecb..38aab625f12e 100644
--- a/drivers/gpu/drm/savage/savage_drv.h
+++ b/drivers/gpu/drm/savage/savage_drv.h
@@ -484,8 +484,10 @@ extern void savage_emit_clip_rect_s4(drm_savage_private_t * dev_priv,
 /*
  * access to MMIO
  */
-#define SAVAGE_READ(reg)	DRM_READ32(  dev_priv->mmio, (reg) )
-#define SAVAGE_WRITE(reg)	DRM_WRITE32( dev_priv->mmio, (reg) )
+#define SAVAGE_READ(reg) \
+       readl(((void __iomem *)dev_priv->mmio->handle) + (reg))
+#define SAVAGE_WRITE(reg) \
+	writel(val, ((void __iomem *)dev_priv->mmio->handle) + (reg))
 
 /*
  * access to the burst command interface (BCI)
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1 2/2] drm/savage: drop use of drmP.h
  2019-06-05 14:03 [PATCH v1 0/2] drm/savage: drop use of drmP.h Sam Ravnborg
  2019-06-05 14:03 ` [PATCH v1 1/2] drm/savage: drop use of drm_os_linux Sam Ravnborg
@ 2019-06-05 14:03 ` Sam Ravnborg
  2019-06-05 16:44   ` Daniel Vetter
  1 sibling, 1 reply; 5+ messages in thread
From: Sam Ravnborg @ 2019-06-05 14:03 UTC (permalink / raw)
  To: dri-devel; +Cc: David Airlie, Sam Ravnborg

Drop use of the deprecated drmP.h header file.
Replace it with the necessary includes of other headers.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
---
 drivers/gpu/drm/savage/savage_bci.c   | 8 +++++++-
 drivers/gpu/drm/savage/savage_drv.c   | 9 +++++----
 drivers/gpu/drm/savage/savage_drv.h   | 4 ++++
 drivers/gpu/drm/savage/savage_state.c | 9 ++++++++-
 4 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/savage/savage_bci.c b/drivers/gpu/drm/savage/savage_bci.c
index aa00cf117433..6889d6534eba 100644
--- a/drivers/gpu/drm/savage/savage_bci.c
+++ b/drivers/gpu/drm/savage/savage_bci.c
@@ -24,9 +24,15 @@
  */
 
 #include <linux/delay.h>
+#include <linux/pci.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
 
-#include <drm/drmP.h>
+#include <drm/drm_device.h>
+#include <drm/drm_file.h>
+#include <drm/drm_print.h>
 #include <drm/savage_drm.h>
+
 #include "savage_drv.h"
 
 /* Need a long timeout for shadow status updates can take a while
diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
index 2bddeb8bf457..2966fcfd9548 100644
--- a/drivers/gpu/drm/savage/savage_drv.c
+++ b/drivers/gpu/drm/savage/savage_drv.c
@@ -25,12 +25,13 @@
 
 #include <linux/module.h>
 
-#include <drm/drmP.h>
-#include <drm/savage_drm.h>
-#include "savage_drv.h"
-
+#include <drm/drm_drv.h>
+#include <drm/drm_file.h>
+#include <drm/drm_pci.h>
 #include <drm/drm_pciids.h>
 
+#include "savage_drv.h"
+
 static struct pci_device_id pciidlist[] = {
 	savage_PCI_IDS
 };
diff --git a/drivers/gpu/drm/savage/savage_drv.h b/drivers/gpu/drm/savage/savage_drv.h
index 38aab625f12e..b0081bb64776 100644
--- a/drivers/gpu/drm/savage/savage_drv.h
+++ b/drivers/gpu/drm/savage/savage_drv.h
@@ -26,7 +26,11 @@
 #ifndef __SAVAGE_DRV_H__
 #define __SAVAGE_DRV_H__
 
+#include <linux/io.h>
+
+#include <drm/drm_ioctl.h>
 #include <drm/drm_legacy.h>
+#include <drm/savage_drm.h>
 
 #define DRIVER_AUTHOR	"Felix Kuehling"
 
diff --git a/drivers/gpu/drm/savage/savage_state.c b/drivers/gpu/drm/savage/savage_state.c
index ebb8b7d32b33..a2ac25c11c90 100644
--- a/drivers/gpu/drm/savage/savage_state.c
+++ b/drivers/gpu/drm/savage/savage_state.c
@@ -22,8 +22,15 @@
  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
-#include <drm/drmP.h>
+
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+
+#include <drm/drm_device.h>
+#include <drm/drm_file.h>
+#include <drm/drm_print.h>
 #include <drm/savage_drm.h>
+
 #include "savage_drv.h"
 
 void savage_emit_clip_rect_s3d(drm_savage_private_t * dev_priv,
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 2/2] drm/savage: drop use of drmP.h
  2019-06-05 14:03 ` [PATCH v1 2/2] drm/savage: drop use of drmP.h Sam Ravnborg
@ 2019-06-05 16:44   ` Daniel Vetter
  2019-06-05 18:35     ` Sam Ravnborg
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2019-06-05 16:44 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: David Airlie, dri-devel

On Wed, Jun 05, 2019 at 04:03:14PM +0200, Sam Ravnborg wrote:
> Drop use of the deprecated drmP.h header file.
> Replace it with the necessary includes of other headers.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>

Assuming it all compiles still, on the series:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Since sis/savage are unmaintained I think you can just go ahead and push
those.
-Daniel

> ---
>  drivers/gpu/drm/savage/savage_bci.c   | 8 +++++++-
>  drivers/gpu/drm/savage/savage_drv.c   | 9 +++++----
>  drivers/gpu/drm/savage/savage_drv.h   | 4 ++++
>  drivers/gpu/drm/savage/savage_state.c | 9 ++++++++-
>  4 files changed, 24 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/savage/savage_bci.c b/drivers/gpu/drm/savage/savage_bci.c
> index aa00cf117433..6889d6534eba 100644
> --- a/drivers/gpu/drm/savage/savage_bci.c
> +++ b/drivers/gpu/drm/savage/savage_bci.c
> @@ -24,9 +24,15 @@
>   */
>  
>  #include <linux/delay.h>
> +#include <linux/pci.h>
> +#include <linux/slab.h>
> +#include <linux/uaccess.h>
>  
> -#include <drm/drmP.h>
> +#include <drm/drm_device.h>
> +#include <drm/drm_file.h>
> +#include <drm/drm_print.h>
>  #include <drm/savage_drm.h>
> +
>  #include "savage_drv.h"
>  
>  /* Need a long timeout for shadow status updates can take a while
> diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
> index 2bddeb8bf457..2966fcfd9548 100644
> --- a/drivers/gpu/drm/savage/savage_drv.c
> +++ b/drivers/gpu/drm/savage/savage_drv.c
> @@ -25,12 +25,13 @@
>  
>  #include <linux/module.h>
>  
> -#include <drm/drmP.h>
> -#include <drm/savage_drm.h>
> -#include "savage_drv.h"
> -
> +#include <drm/drm_drv.h>
> +#include <drm/drm_file.h>
> +#include <drm/drm_pci.h>
>  #include <drm/drm_pciids.h>
>  
> +#include "savage_drv.h"
> +
>  static struct pci_device_id pciidlist[] = {
>  	savage_PCI_IDS
>  };
> diff --git a/drivers/gpu/drm/savage/savage_drv.h b/drivers/gpu/drm/savage/savage_drv.h
> index 38aab625f12e..b0081bb64776 100644
> --- a/drivers/gpu/drm/savage/savage_drv.h
> +++ b/drivers/gpu/drm/savage/savage_drv.h
> @@ -26,7 +26,11 @@
>  #ifndef __SAVAGE_DRV_H__
>  #define __SAVAGE_DRV_H__
>  
> +#include <linux/io.h>
> +
> +#include <drm/drm_ioctl.h>
>  #include <drm/drm_legacy.h>
> +#include <drm/savage_drm.h>
>  
>  #define DRIVER_AUTHOR	"Felix Kuehling"
>  
> diff --git a/drivers/gpu/drm/savage/savage_state.c b/drivers/gpu/drm/savage/savage_state.c
> index ebb8b7d32b33..a2ac25c11c90 100644
> --- a/drivers/gpu/drm/savage/savage_state.c
> +++ b/drivers/gpu/drm/savage/savage_state.c
> @@ -22,8 +22,15 @@
>   * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
>   * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
>   */
> -#include <drm/drmP.h>
> +
> +#include <linux/slab.h>
> +#include <linux/uaccess.h>
> +
> +#include <drm/drm_device.h>
> +#include <drm/drm_file.h>
> +#include <drm/drm_print.h>
>  #include <drm/savage_drm.h>
> +
>  #include "savage_drv.h"
>  
>  void savage_emit_clip_rect_s3d(drm_savage_private_t * dev_priv,
> -- 
> 2.20.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 2/2] drm/savage: drop use of drmP.h
  2019-06-05 16:44   ` Daniel Vetter
@ 2019-06-05 18:35     ` Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2019-06-05 18:35 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: David Airlie, dri-devel

On Wed, Jun 05, 2019 at 06:44:53PM +0200, Daniel Vetter wrote:
> On Wed, Jun 05, 2019 at 04:03:14PM +0200, Sam Ravnborg wrote:
> > Drop use of the deprecated drmP.h header file.
> > Replace it with the necessary includes of other headers.
> > 
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> 
> Assuming it all compiles still, on the series:
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Thanks,

pushed to drm-misc-next now.

	Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-05 18:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 14:03 [PATCH v1 0/2] drm/savage: drop use of drmP.h Sam Ravnborg
2019-06-05 14:03 ` [PATCH v1 1/2] drm/savage: drop use of drm_os_linux Sam Ravnborg
2019-06-05 14:03 ` [PATCH v1 2/2] drm/savage: drop use of drmP.h Sam Ravnborg
2019-06-05 16:44   ` Daniel Vetter
2019-06-05 18:35     ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.