[RFC,v1,02/27] libcamera: request: Inline `Private::hasPendingRequests()`
diff mbox series

Message ID 20260618123844.656396-3-barnabas.pocze@ideasonboard.com
State Accepted
Headers show
Series
  • Misc. changes before request-buffer split
Related show

Commit Message

Barnabás Pőcze June 18, 2026, 12:38 p.m. UTC
It is a trivial function, inline it.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 include/libcamera/internal/request.h | 2 +-
 src/libcamera/request.cpp            | 5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

Jacopo Mondi June 22, 2026, 12:19 p.m. UTC | #1
On Thu, Jun 18, 2026 at 02:38:19PM +0200, Barnabás Pőcze wrote:
> It is a trivial function, inline it.
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

> ---
>  include/libcamera/internal/request.h | 2 +-
>  src/libcamera/request.cpp            | 5 +----
>  2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
> index 693097ee9a..382ed28bca 100644
> --- a/include/libcamera/internal/request.h
> +++ b/include/libcamera/internal/request.h
> @@ -34,7 +34,7 @@ public:
>  	~Private();
>
>  	Camera *camera() const { return camera_; }
> -	bool hasPendingBuffers() const;
> +	bool hasPendingBuffers() const { return !pending_.empty(); }
>
>  	ControlList &metadata() { return metadata_; }
>
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index b50a642052..e31c9c006a 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -74,15 +74,12 @@ Request::Private::~Private()
>   */
>
>  /**
> + * \fn Request::Private::hasPendingBuffers()
>   * \brief Check if a request has buffers yet to be completed
>   *
>   * \return True if the request has buffers pending for completion, false
>   * otherwise
>   */
> -bool Request::Private::hasPendingBuffers() const
> -{
> -	return !pending_.empty();
> -}
>
>  /**
>   * \fn Request::Private::metadata()
> --
> 2.54.0
>
Jacopo Mondi June 22, 2026, 12:20 p.m. UTC | #2
Sorry, in subject Requests/Buffers

On Thu, Jun 18, 2026 at 02:38:19PM +0200, Barnabás Pőcze wrote:
> It is a trivial function, inline it.
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  include/libcamera/internal/request.h | 2 +-
>  src/libcamera/request.cpp            | 5 +----
>  2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
> index 693097ee9a..382ed28bca 100644
> --- a/include/libcamera/internal/request.h
> +++ b/include/libcamera/internal/request.h
> @@ -34,7 +34,7 @@ public:
>  	~Private();
>
>  	Camera *camera() const { return camera_; }
> -	bool hasPendingBuffers() const;
> +	bool hasPendingBuffers() const { return !pending_.empty(); }
>
>  	ControlList &metadata() { return metadata_; }
>
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index b50a642052..e31c9c006a 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -74,15 +74,12 @@ Request::Private::~Private()
>   */
>
>  /**
> + * \fn Request::Private::hasPendingBuffers()
>   * \brief Check if a request has buffers yet to be completed
>   *
>   * \return True if the request has buffers pending for completion, false
>   * otherwise
>   */
> -bool Request::Private::hasPendingBuffers() const
> -{
> -	return !pending_.empty();
> -}
>
>  /**
>   * \fn Request::Private::metadata()
> --
> 2.54.0
>
Barnabás Pőcze June 22, 2026, 2:14 p.m. UTC | #3
2026. 06. 22. 14:20 keltezéssel, Jacopo Mondi írta:
> Sorry, in subject Requests/Buffers

You mean you'd like to see

   libcamera: request: Inline `Request::Private::hasPendingRequests()`

?

> 
> On Thu, Jun 18, 2026 at 02:38:19PM +0200, Barnabás Pőcze wrote:
>> It is a trivial function, inline it.
>>
>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
>> ---
>>   include/libcamera/internal/request.h | 2 +-
>>   src/libcamera/request.cpp            | 5 +----
>>   2 files changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
>> index 693097ee9a..382ed28bca 100644
>> --- a/include/libcamera/internal/request.h
>> +++ b/include/libcamera/internal/request.h
>> @@ -34,7 +34,7 @@ public:
>>   	~Private();
>>
>>   	Camera *camera() const { return camera_; }
>> -	bool hasPendingBuffers() const;
>> +	bool hasPendingBuffers() const { return !pending_.empty(); }
>>
>>   	ControlList &metadata() { return metadata_; }
>>
>> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
>> index b50a642052..e31c9c006a 100644
>> --- a/src/libcamera/request.cpp
>> +++ b/src/libcamera/request.cpp
>> @@ -74,15 +74,12 @@ Request::Private::~Private()
>>    */
>>
>>   /**
>> + * \fn Request::Private::hasPendingBuffers()
>>    * \brief Check if a request has buffers yet to be completed
>>    *
>>    * \return True if the request has buffers pending for completion, false
>>    * otherwise
>>    */
>> -bool Request::Private::hasPendingBuffers() const
>> -{
>> -	return !pending_.empty();
>> -}
>>
>>   /**
>>    * \fn Request::Private::metadata()
>> --
>> 2.54.0
>>
Jacopo Mondi June 22, 2026, 2:23 p.m. UTC | #4
On Mon, Jun 22, 2026 at 04:14:14PM +0200, Barnabás Pőcze wrote:
> 2026. 06. 22. 14:20 keltezéssel, Jacopo Mondi írta:
> > Sorry, in subject Requests/Buffers
>
> You mean you'd like to see
>
>   libcamera: request: Inline `Request::Private::hasPendingRequests()`

Am I wrong or are you inlining hasPendingBuffers() and not
hasPendingRequests ?

>
> ?
>
> >
> > On Thu, Jun 18, 2026 at 02:38:19PM +0200, Barnabás Pőcze wrote:
> > > It is a trivial function, inline it.
> > >
> > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> > > ---
> > >   include/libcamera/internal/request.h | 2 +-
> > >   src/libcamera/request.cpp            | 5 +----
> > >   2 files changed, 2 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
> > > index 693097ee9a..382ed28bca 100644
> > > --- a/include/libcamera/internal/request.h
> > > +++ b/include/libcamera/internal/request.h
> > > @@ -34,7 +34,7 @@ public:
> > >   	~Private();
> > >
> > >   	Camera *camera() const { return camera_; }
> > > -	bool hasPendingBuffers() const;
> > > +	bool hasPendingBuffers() const { return !pending_.empty(); }
> > >
> > >   	ControlList &metadata() { return metadata_; }
> > >
> > > diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> > > index b50a642052..e31c9c006a 100644
> > > --- a/src/libcamera/request.cpp
> > > +++ b/src/libcamera/request.cpp
> > > @@ -74,15 +74,12 @@ Request::Private::~Private()
> > >    */
> > >
> > >   /**
> > > + * \fn Request::Private::hasPendingBuffers()
> > >    * \brief Check if a request has buffers yet to be completed
> > >    *
> > >    * \return True if the request has buffers pending for completion, false
> > >    * otherwise
> > >    */
> > > -bool Request::Private::hasPendingBuffers() const
> > > -{
> > > -	return !pending_.empty();
> > > -}
> > >
> > >   /**
> > >    * \fn Request::Private::metadata()
> > > --
> > > 2.54.0
> > >
>
Barnabás Pőcze June 22, 2026, 2:24 p.m. UTC | #5
2026. 06. 22. 16:23 keltezéssel, Jacopo Mondi írta:
> On Mon, Jun 22, 2026 at 04:14:14PM +0200, Barnabás Pőcze wrote:
>> 2026. 06. 22. 14:20 keltezéssel, Jacopo Mondi írta:
>>> Sorry, in subject Requests/Buffers
>>
>> You mean you'd like to see
>>
>>    libcamera: request: Inline `Request::Private::hasPendingRequests()`
> 
> Am I wrong or are you inlining hasPendingBuffers() and not
> hasPendingRequests ?

Ahh, you're right, I didn't notice my mistake.


> 
>>
>> ?
>>
>>>
>>> On Thu, Jun 18, 2026 at 02:38:19PM +0200, Barnabás Pőcze wrote:
>>>> It is a trivial function, inline it.
>>>>
>>>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
>>>> ---
>>>>    include/libcamera/internal/request.h | 2 +-
>>>>    src/libcamera/request.cpp            | 5 +----
>>>>    2 files changed, 2 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
>>>> index 693097ee9a..382ed28bca 100644
>>>> --- a/include/libcamera/internal/request.h
>>>> +++ b/include/libcamera/internal/request.h
>>>> @@ -34,7 +34,7 @@ public:
>>>>    	~Private();
>>>>
>>>>    	Camera *camera() const { return camera_; }
>>>> -	bool hasPendingBuffers() const;
>>>> +	bool hasPendingBuffers() const { return !pending_.empty(); }
>>>>
>>>>    	ControlList &metadata() { return metadata_; }
>>>>
>>>> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
>>>> index b50a642052..e31c9c006a 100644
>>>> --- a/src/libcamera/request.cpp
>>>> +++ b/src/libcamera/request.cpp
>>>> @@ -74,15 +74,12 @@ Request::Private::~Private()
>>>>     */
>>>>
>>>>    /**
>>>> + * \fn Request::Private::hasPendingBuffers()
>>>>     * \brief Check if a request has buffers yet to be completed
>>>>     *
>>>>     * \return True if the request has buffers pending for completion, false
>>>>     * otherwise
>>>>     */
>>>> -bool Request::Private::hasPendingBuffers() const
>>>> -{
>>>> -	return !pending_.empty();
>>>> -}
>>>>
>>>>    /**
>>>>     * \fn Request::Private::metadata()
>>>> --
>>>> 2.54.0
>>>>
>>
Laurent Pinchart June 22, 2026, 10:41 p.m. UTC | #6
On Mon, Jun 22, 2026 at 04:24:41PM +0200, Barnabás Pőcze wrote:
> 2026. 06. 22. 16:23 keltezéssel, Jacopo Mondi írta:
> > On Mon, Jun 22, 2026 at 04:14:14PM +0200, Barnabás Pőcze wrote:
> >> 2026. 06. 22. 14:20 keltezéssel, Jacopo Mondi írta:
> >>> Sorry, in subject Requests/Buffers
> >>
> >> You mean you'd like to see
> >>
> >>    libcamera: request: Inline `Request::Private::hasPendingRequests()`
> > 
> > Am I wrong or are you inlining hasPendingBuffers() and not
> > hasPendingRequests ?
> 
> Ahh, you're right, I didn't notice my mistake.

With this fixed,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> >> ?
> >>
> >>> On Thu, Jun 18, 2026 at 02:38:19PM +0200, Barnabás Pőcze wrote:
> >>>> It is a trivial function, inline it.
> >>>>
> >>>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> >>>> ---
> >>>>    include/libcamera/internal/request.h | 2 +-
> >>>>    src/libcamera/request.cpp            | 5 +----
> >>>>    2 files changed, 2 insertions(+), 5 deletions(-)
> >>>>
> >>>> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
> >>>> index 693097ee9a..382ed28bca 100644
> >>>> --- a/include/libcamera/internal/request.h
> >>>> +++ b/include/libcamera/internal/request.h
> >>>> @@ -34,7 +34,7 @@ public:
> >>>>    	~Private();
> >>>>
> >>>>    	Camera *camera() const { return camera_; }
> >>>> -	bool hasPendingBuffers() const;
> >>>> +	bool hasPendingBuffers() const { return !pending_.empty(); }
> >>>>
> >>>>    	ControlList &metadata() { return metadata_; }
> >>>>
> >>>> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> >>>> index b50a642052..e31c9c006a 100644
> >>>> --- a/src/libcamera/request.cpp
> >>>> +++ b/src/libcamera/request.cpp
> >>>> @@ -74,15 +74,12 @@ Request::Private::~Private()
> >>>>     */
> >>>>
> >>>>    /**
> >>>> + * \fn Request::Private::hasPendingBuffers()
> >>>>     * \brief Check if a request has buffers yet to be completed
> >>>>     *
> >>>>     * \return True if the request has buffers pending for completion, false
> >>>>     * otherwise
> >>>>     */
> >>>> -bool Request::Private::hasPendingBuffers() const
> >>>> -{
> >>>> -	return !pending_.empty();
> >>>> -}
> >>>>
> >>>>    /**
> >>>>     * \fn Request::Private::metadata()

Patch
diff mbox series

diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
index 693097ee9a..382ed28bca 100644
--- a/include/libcamera/internal/request.h
+++ b/include/libcamera/internal/request.h
@@ -34,7 +34,7 @@  public:
 	~Private();
 
 	Camera *camera() const { return camera_; }
-	bool hasPendingBuffers() const;
+	bool hasPendingBuffers() const { return !pending_.empty(); }
 
 	ControlList &metadata() { return metadata_; }
 
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index b50a642052..e31c9c006a 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -74,15 +74,12 @@  Request::Private::~Private()
  */
 
 /**
+ * \fn Request::Private::hasPendingBuffers()
  * \brief Check if a request has buffers yet to be completed
  *
  * \return True if the request has buffers pending for completion, false
  * otherwise
  */
-bool Request::Private::hasPendingBuffers() const
-{
-	return !pending_.empty();
-}
 
 /**
  * \fn Request::Private::metadata()