[PATCH 10/16] drm/gma500: Use unsigned int pipe consistently
Thierry Reding
thierry.reding at gmail.com
Thu Sep 24 09:35:32 PDT 2015
From: Thierry Reding <treding at nvidia.com>
The pipe number can never be negative, so turn variables referring to it
to unsigned int.
Cc: Patrik Jakobsson <patrik.r.jakobsson at gmail.com>
Signed-off-by: Thierry Reding <treding at nvidia.com>
---
drivers/gpu/drm/gma500/psb_drv.h | 8 ++++----
drivers/gpu/drm/gma500/psb_irq.c | 30 ++++++++++++++++--------------
drivers/gpu/drm/gma500/psb_irq.h | 4 ++--
3 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
index e21726ecac32..5920a896da1b 100644
--- a/drivers/gpu/drm/gma500/psb_drv.h
+++ b/drivers/gpu/drm/gma500/psb_drv.h
@@ -689,11 +689,11 @@ extern int psb_vblank_wait2(struct drm_device *dev, unsigned int *sequence);
extern int psb_vblank_wait(struct drm_device *dev, unsigned int *sequence);
extern int psb_enable_vblank(struct drm_device *dev, unsigned int pipe);
extern void psb_disable_vblank(struct drm_device *dev, unsigned int pipe);
-void
-psb_enable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask);
+void psb_enable_pipestat(struct drm_psb_private *dev_priv, unsigned int pipe,
+ u32 mask);
-void
-psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask);
+void psb_disable_pipestat(struct drm_psb_private *dev_priv, unsigned int pipe,
+ u32 mask);
extern u32 psb_get_vblank_counter(struct drm_device *dev, unsigned int pipe);
diff --git a/drivers/gpu/drm/gma500/psb_irq.c b/drivers/gpu/drm/gma500/psb_irq.c
index 78eb10902809..6e383d4d097b 100644
--- a/drivers/gpu/drm/gma500/psb_irq.c
+++ b/drivers/gpu/drm/gma500/psb_irq.c
@@ -35,7 +35,7 @@
*/
static inline u32
-psb_pipestat(int pipe)
+psb_pipestat(unsigned int pipe)
{
if (pipe == 0)
return PIPEASTAT;
@@ -47,7 +47,7 @@ psb_pipestat(int pipe)
}
static inline u32
-mid_pipe_event(int pipe)
+mid_pipe_event(unsigned int pipe)
{
if (pipe == 0)
return _PSB_PIPEA_EVENT_FLAG;
@@ -59,7 +59,7 @@ mid_pipe_event(int pipe)
}
static inline u32
-mid_pipe_vsync(int pipe)
+mid_pipe_vsync(unsigned int pipe)
{
if (pipe == 0)
return _PSB_VSYNC_PIPEA_FLAG;
@@ -71,7 +71,7 @@ mid_pipe_vsync(int pipe)
}
static inline u32
-mid_pipeconf(int pipe)
+mid_pipeconf(unsigned int pipe)
{
if (pipe == 0)
return PIPEACONF;
@@ -82,8 +82,8 @@ mid_pipeconf(int pipe)
BUG();
}
-void
-psb_enable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
+void psb_enable_pipestat(struct drm_psb_private *dev_priv, unsigned int pipe,
+ u32 mask)
{
if ((dev_priv->pipestat[pipe] & mask) != mask) {
u32 reg = psb_pipestat(pipe);
@@ -99,8 +99,8 @@ psb_enable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
}
}
-void
-psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
+void psb_disable_pipestat(struct drm_psb_private *dev_priv, unsigned int pipe,
+ u32 mask)
{
if ((dev_priv->pipestat[pipe] & mask) != 0) {
u32 reg = psb_pipestat(pipe);
@@ -115,7 +115,8 @@ psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
}
}
-static void mid_enable_pipe_event(struct drm_psb_private *dev_priv, int pipe)
+static void mid_enable_pipe_event(struct drm_psb_private *dev_priv,
+ unsigned int pipe)
{
if (gma_power_begin(dev_priv->dev, false)) {
u32 pipe_event = mid_pipe_event(pipe);
@@ -126,7 +127,8 @@ static void mid_enable_pipe_event(struct drm_psb_private *dev_priv, int pipe)
}
}
-static void mid_disable_pipe_event(struct drm_psb_private *dev_priv, int pipe)
+static void mid_disable_pipe_event(struct drm_psb_private *dev_priv,
+ unsigned int pipe)
{
if (dev_priv->pipestat[pipe] == 0) {
if (gma_power_begin(dev_priv->dev, false)) {
@@ -143,7 +145,7 @@ static void mid_disable_pipe_event(struct drm_psb_private *dev_priv, int pipe)
* Display controller interrupt handler for pipe event.
*
*/
-static void mid_pipe_event_handler(struct drm_device *dev, int pipe)
+static void mid_pipe_event_handler(struct drm_device *dev, unsigned int pipe)
{
struct drm_psb_private *dev_priv =
(struct drm_psb_private *) dev->dev_private;
@@ -175,7 +177,7 @@ static void mid_pipe_event_handler(struct drm_device *dev, int pipe)
if (pipe_clear)
dev_err(dev->dev,
- "%s, can't clear status bits for pipe %d, its value = 0x%x.\n",
+ "%s, can't clear status bits for pipe %u, its value = 0x%x.\n",
__func__, pipe, PSB_RVDC32(pipe_stat_reg));
if (pipe_stat_val & PIPE_VBLANK_STATUS)
@@ -573,7 +575,7 @@ void psb_disable_vblank(struct drm_device *dev, unsigned int pipe)
/*
* It is used to enable TE interrupt
*/
-int mdfld_enable_te(struct drm_device *dev, int pipe)
+int mdfld_enable_te(struct drm_device *dev, unsigned int pipe)
{
struct drm_psb_private *dev_priv =
(struct drm_psb_private *) dev->dev_private;
@@ -602,7 +604,7 @@ int mdfld_enable_te(struct drm_device *dev, int pipe)
/*
* It is used to disable TE interrupt
*/
-void mdfld_disable_te(struct drm_device *dev, int pipe)
+void mdfld_disable_te(struct drm_device *dev, unsigned int pipe)
{
struct drm_psb_private *dev_priv =
(struct drm_psb_private *) dev->dev_private;
diff --git a/drivers/gpu/drm/gma500/psb_irq.h b/drivers/gpu/drm/gma500/psb_irq.h
index e6a81a8c9f35..cbf64a10c92d 100644
--- a/drivers/gpu/drm/gma500/psb_irq.h
+++ b/drivers/gpu/drm/gma500/psb_irq.h
@@ -42,6 +42,6 @@ int psb_enable_vblank(struct drm_device *dev, unsigned int pipe);
void psb_disable_vblank(struct drm_device *dev, unsigned int pipe);
u32 psb_get_vblank_counter(struct drm_device *dev, unsigned int pipe);
-int mdfld_enable_te(struct drm_device *dev, int pipe);
-void mdfld_disable_te(struct drm_device *dev, int pipe);
+int mdfld_enable_te(struct drm_device *dev, unsigned int pipe);
+void mdfld_disable_te(struct drm_device *dev, unsigned int pipe);
#endif /* _PSB_IRQ_H_ */
--
2.5.0
More information about the dri-devel
mailing list