[2/2] drm: s/int pipe/unsigned int pipe/
diff mbox

Message ID 1443620809-28329-2-git-send-email-ville.syrjala@linux.intel.com
State New
Headers show

Commit Message

Ville Syrjälä Sept. 30, 2015, 1:46 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Make the 'pipe' argument to drm_vblank_count() unsigned as it is
everwhere else.

Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_irq.c | 2 +-
 include/drm/drmP.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Vincent Abriou Oct. 2, 2015, 1:07 p.m. UTC | #1
Hi,

On 09/30/2015 03:46 PM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>

>

> Make the 'pipe' argument to drm_vblank_count() unsigned as it is

> everwhere else.

>

> Cc: Vincent Abriou <vincent.abriou@st.com>

> Cc: Thierry Reding <treding@nvidia.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---

>   drivers/gpu/drm/drm_irq.c | 2 +-

>   include/drm/drmP.h        | 2 +-

>   2 files changed, 2 insertions(+), 2 deletions(-)

>

> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c

> index 7d70b7c..f24c57c 100644

> --- a/drivers/gpu/drm/drm_irq.c

> +++ b/drivers/gpu/drm/drm_irq.c

> @@ -876,7 +876,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,

>    * Returns:

>    * The software vblank counter.

>    */

> -u32 drm_vblank_count(struct drm_device *dev, int pipe)

> +u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)

>   {

>   	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];

>

> diff --git a/include/drm/drmP.h b/include/drm/drmP.h

> index f563333..8df4de7 100644

> --- a/include/drm/drmP.h

> +++ b/include/drm/drmP.h

> @@ -928,7 +928,7 @@ extern int drm_irq_uninstall(struct drm_device *dev);

>   extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);

>   extern int drm_wait_vblank(struct drm_device *dev, void *data,

>   			   struct drm_file *filp);

> -extern u32 drm_vblank_count(struct drm_device *dev, int pipe);

> +extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe);

>   extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);

>   extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,

>   				     struct timeval *vblanktime);

>



If you update drm_vblank_count you also need to update 
drm_vblank_no_hw_counter and need to change the u32 
(*get_vblank_counter) prototype.

Thierry already done the job with "drm/irq: Use unsigned int pipe in 
public API" patch

BR
Vincent
Ville Syrjälä Oct. 2, 2015, 1:12 p.m. UTC | #2
On Fri, Oct 02, 2015 at 03:07:50PM +0200, Vincent ABRIOU wrote:
> Hi,
> 
> On 09/30/2015 03:46 PM, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Make the 'pipe' argument to drm_vblank_count() unsigned as it is
> > everwhere else.
> >
> > Cc: Vincent Abriou <vincent.abriou@st.com>
> > Cc: Thierry Reding <treding@nvidia.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >   drivers/gpu/drm/drm_irq.c | 2 +-
> >   include/drm/drmP.h        | 2 +-
> >   2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> > index 7d70b7c..f24c57c 100644
> > --- a/drivers/gpu/drm/drm_irq.c
> > +++ b/drivers/gpu/drm/drm_irq.c
> > @@ -876,7 +876,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
> >    * Returns:
> >    * The software vblank counter.
> >    */
> > -u32 drm_vblank_count(struct drm_device *dev, int pipe)
> > +u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
> >   {
> >   	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> >
> > diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> > index f563333..8df4de7 100644
> > --- a/include/drm/drmP.h
> > +++ b/include/drm/drmP.h
> > @@ -928,7 +928,7 @@ extern int drm_irq_uninstall(struct drm_device *dev);
> >   extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
> >   extern int drm_wait_vblank(struct drm_device *dev, void *data,
> >   			   struct drm_file *filp);
> > -extern u32 drm_vblank_count(struct drm_device *dev, int pipe);
> > +extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe);
> >   extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
> >   extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
> >   				     struct timeval *vblanktime);
> >
> 
> 
> If you update drm_vblank_count you also need to update 
> drm_vblank_no_hw_counter and need to change the u32 
> (*get_vblank_counter) prototype.

No. drm_vblank_count() != .get_vblank_counter()

> 
> Thierry already done the job with "drm/irq: Use unsigned int pipe in 
> public API" patch

Yes I know. Except all the driver hooks still have signed ints. I looked
at changing that, and it looked like quite a bit of work, so probably
a job for coccinelle. I wonder if it has a way to figure out which
functions are plugged into these hooks and do the job entirely
automatically...
Vincent Abriou Oct. 2, 2015, 1:22 p.m. UTC | #3
On 10/02/2015 03:12 PM, Ville Syrjälä wrote:
> On Fri, Oct 02, 2015 at 03:07:50PM +0200, Vincent ABRIOU wrote:
>> Hi,
>>
>> On 09/30/2015 03:46 PM, ville.syrjala@linux.intel.com wrote:
>>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>
>>> Make the 'pipe' argument to drm_vblank_count() unsigned as it is
>>> everwhere else.
>>>
>>> Cc: Vincent Abriou <vincent.abriou@st.com>
>>> Cc: Thierry Reding <treding@nvidia.com>
>>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>> ---
>>>    drivers/gpu/drm/drm_irq.c | 2 +-
>>>    include/drm/drmP.h        | 2 +-
>>>    2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
>>> index 7d70b7c..f24c57c 100644
>>> --- a/drivers/gpu/drm/drm_irq.c
>>> +++ b/drivers/gpu/drm/drm_irq.c
>>> @@ -876,7 +876,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
>>>     * Returns:
>>>     * The software vblank counter.
>>>     */
>>> -u32 drm_vblank_count(struct drm_device *dev, int pipe)
>>> +u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
>>>    {
>>>    	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
>>>
>>> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
>>> index f563333..8df4de7 100644
>>> --- a/include/drm/drmP.h
>>> +++ b/include/drm/drmP.h
>>> @@ -928,7 +928,7 @@ extern int drm_irq_uninstall(struct drm_device *dev);
>>>    extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
>>>    extern int drm_wait_vblank(struct drm_device *dev, void *data,
>>>    			   struct drm_file *filp);
>>> -extern u32 drm_vblank_count(struct drm_device *dev, int pipe);
>>> +extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe);
>>>    extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
>>>    extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
>>>    				     struct timeval *vblanktime);
>>>
>>
>>
>> If you update drm_vblank_count you also need to update
>> drm_vblank_no_hw_counter and need to change the u32
>> (*get_vblank_counter) prototype.
>
> No. drm_vblank_count() != .get_vblank_counter()

I surely miss something but before your patch in drivers that did not 
support hw vblank counter we had:
.get_vblank_counter = drm_vblank_count;

>
>>
>> Thierry already done the job with "drm/irq: Use unsigned int pipe in
>> public API" patch
>
> Yes I know. Except all the driver hooks still have signed ints. I looked
> at changing that, and it looked like quite a bit of work, so probably
> a job for coccinelle. I wonder if it has a way to figure out which
> functions are plugged into these hooks and do the job entirely
> automatically...
>
Ville Syrjälä Oct. 2, 2015, 3:39 p.m. UTC | #4
On Fri, Oct 02, 2015 at 03:22:16PM +0200, Vincent ABRIOU wrote:
> 
> 
> On 10/02/2015 03:12 PM, Ville Syrjälä wrote:
> > On Fri, Oct 02, 2015 at 03:07:50PM +0200, Vincent ABRIOU wrote:
> >> Hi,
> >>
> >> On 09/30/2015 03:46 PM, ville.syrjala@linux.intel.com wrote:
> >>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>>
> >>> Make the 'pipe' argument to drm_vblank_count() unsigned as it is
> >>> everwhere else.
> >>>
> >>> Cc: Vincent Abriou <vincent.abriou@st.com>
> >>> Cc: Thierry Reding <treding@nvidia.com>
> >>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>> ---
> >>>    drivers/gpu/drm/drm_irq.c | 2 +-
> >>>    include/drm/drmP.h        | 2 +-
> >>>    2 files changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> >>> index 7d70b7c..f24c57c 100644
> >>> --- a/drivers/gpu/drm/drm_irq.c
> >>> +++ b/drivers/gpu/drm/drm_irq.c
> >>> @@ -876,7 +876,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
> >>>     * Returns:
> >>>     * The software vblank counter.
> >>>     */
> >>> -u32 drm_vblank_count(struct drm_device *dev, int pipe)
> >>> +u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
> >>>    {
> >>>    	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> >>>
> >>> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> >>> index f563333..8df4de7 100644
> >>> --- a/include/drm/drmP.h
> >>> +++ b/include/drm/drmP.h
> >>> @@ -928,7 +928,7 @@ extern int drm_irq_uninstall(struct drm_device *dev);
> >>>    extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
> >>>    extern int drm_wait_vblank(struct drm_device *dev, void *data,
> >>>    			   struct drm_file *filp);
> >>> -extern u32 drm_vblank_count(struct drm_device *dev, int pipe);
> >>> +extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe);
> >>>    extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
> >>>    extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
> >>>    				     struct timeval *vblanktime);
> >>>
> >>
> >>
> >> If you update drm_vblank_count you also need to update
> >> drm_vblank_no_hw_counter and need to change the u32
> >> (*get_vblank_counter) prototype.
> >
> > No. drm_vblank_count() != .get_vblank_counter()
> 
> I surely miss something but before your patch in drivers that did not 
> support hw vblank counter we had:
> .get_vblank_counter = drm_vblank_count;

That was what patch 1/2 fixed.
Thierry Reding Oct. 6, 2015, 9:36 a.m. UTC | #5
On Fri, Oct 02, 2015 at 04:12:49PM +0300, Ville Syrjälä wrote:
> On Fri, Oct 02, 2015 at 03:07:50PM +0200, Vincent ABRIOU wrote:
> > Hi,
> > 
> > On 09/30/2015 03:46 PM, ville.syrjala@linux.intel.com wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > Make the 'pipe' argument to drm_vblank_count() unsigned as it is
> > > everwhere else.
> > >
> > > Cc: Vincent Abriou <vincent.abriou@st.com>
> > > Cc: Thierry Reding <treding@nvidia.com>
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >   drivers/gpu/drm/drm_irq.c | 2 +-
> > >   include/drm/drmP.h        | 2 +-
> > >   2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> > > index 7d70b7c..f24c57c 100644
> > > --- a/drivers/gpu/drm/drm_irq.c
> > > +++ b/drivers/gpu/drm/drm_irq.c
> > > @@ -876,7 +876,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
> > >    * Returns:
> > >    * The software vblank counter.
> > >    */
> > > -u32 drm_vblank_count(struct drm_device *dev, int pipe)
> > > +u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
> > >   {
> > >   	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> > >
> > > diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> > > index f563333..8df4de7 100644
> > > --- a/include/drm/drmP.h
> > > +++ b/include/drm/drmP.h
> > > @@ -928,7 +928,7 @@ extern int drm_irq_uninstall(struct drm_device *dev);
> > >   extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
> > >   extern int drm_wait_vblank(struct drm_device *dev, void *data,
> > >   			   struct drm_file *filp);
> > > -extern u32 drm_vblank_count(struct drm_device *dev, int pipe);
> > > +extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe);
> > >   extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
> > >   extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
> > >   				     struct timeval *vblanktime);
> > >
> > 
> > 
> > If you update drm_vblank_count you also need to update 
> > drm_vblank_no_hw_counter and need to change the u32 
> > (*get_vblank_counter) prototype.
> 
> No. drm_vblank_count() != .get_vblank_counter()
> 
> > 
> > Thierry already done the job with "drm/irq: Use unsigned int pipe in 
> > public API" patch
> 
> Yes I know. Except all the driver hooks still have signed ints. I looked
> at changing that, and it looked like quite a bit of work, so probably
> a job for coccinelle. I wonder if it has a way to figure out which
> functions are plugged into these hooks and do the job entirely
> automatically...

Actually the above-mentioned patch updated drivers as well, otherwise
there would've been tons of warnings from mismatched types.

Thierry
Vincent Abriou Oct. 7, 2015, 1:12 p.m. UTC | #6
Reviewed-by: Vincent Abriou <vincent.abriou@st.com>

On 10/02/2015 05:39 PM, Ville Syrjälä wrote:
> On Fri, Oct 02, 2015 at 03:22:16PM +0200, Vincent ABRIOU wrote:
>>
>>
>> On 10/02/2015 03:12 PM, Ville Syrjälä wrote:
>>> On Fri, Oct 02, 2015 at 03:07:50PM +0200, Vincent ABRIOU wrote:
>>>> Hi,
>>>>
>>>> On 09/30/2015 03:46 PM, ville.syrjala@linux.intel.com wrote:
>>>>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>>>
>>>>> Make the 'pipe' argument to drm_vblank_count() unsigned as it is
>>>>> everwhere else.
>>>>>
>>>>> Cc: Vincent Abriou <vincent.abriou@st.com>
>>>>> Cc: Thierry Reding <treding@nvidia.com>
>>>>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>>> ---
>>>>>     drivers/gpu/drm/drm_irq.c | 2 +-
>>>>>     include/drm/drmP.h        | 2 +-
>>>>>     2 files changed, 2 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
>>>>> index 7d70b7c..f24c57c 100644
>>>>> --- a/drivers/gpu/drm/drm_irq.c
>>>>> +++ b/drivers/gpu/drm/drm_irq.c
>>>>> @@ -876,7 +876,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
>>>>>      * Returns:
>>>>>      * The software vblank counter.
>>>>>      */
>>>>> -u32 drm_vblank_count(struct drm_device *dev, int pipe)
>>>>> +u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
>>>>>     {
>>>>>     	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
>>>>>
>>>>> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
>>>>> index f563333..8df4de7 100644
>>>>> --- a/include/drm/drmP.h
>>>>> +++ b/include/drm/drmP.h
>>>>> @@ -928,7 +928,7 @@ extern int drm_irq_uninstall(struct drm_device *dev);
>>>>>     extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
>>>>>     extern int drm_wait_vblank(struct drm_device *dev, void *data,
>>>>>     			   struct drm_file *filp);
>>>>> -extern u32 drm_vblank_count(struct drm_device *dev, int pipe);
>>>>> +extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe);
>>>>>     extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
>>>>>     extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
>>>>>     				     struct timeval *vblanktime);
>>>>>
>>>>
>>>>
>>>> If you update drm_vblank_count you also need to update
>>>> drm_vblank_no_hw_counter and need to change the u32
>>>> (*get_vblank_counter) prototype.
>>>
>>> No. drm_vblank_count() != .get_vblank_counter()
>>
>> I surely miss something but before your patch in drivers that did not
>> support hw vblank counter we had:
>> .get_vblank_counter = drm_vblank_count;
>
> That was what patch 1/2 fixed.
>

Patch
diff mbox

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 7d70b7c..f24c57c 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -876,7 +876,7 @@  drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
  * Returns:
  * The software vblank counter.
  */
-u32 drm_vblank_count(struct drm_device *dev, int pipe)
+u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
 {
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index f563333..8df4de7 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -928,7 +928,7 @@  extern int drm_irq_uninstall(struct drm_device *dev);
 extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
 extern int drm_wait_vblank(struct drm_device *dev, void *data,
 			   struct drm_file *filp);
-extern u32 drm_vblank_count(struct drm_device *dev, int pipe);
+extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe);
 extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
 extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
 				     struct timeval *vblanktime);