Re: [PATCH hwc v2 5/6] drm_hwcomposer: Add GetCrtcCount function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2017-09-27 at 15:12 -0400, Sean Paul wrote:
> On Wed, Sep 27, 2017 at 7:58 AM, Robert Foss <robert.foss@collabora.c
> om> wrote:
> > This GetCrtrcCount helper functions enables convenient
> > fetching of the number of Crtcs from DrmResources.
> > 
> > Signed-off-by: Robert Foss <robert.foss@xxxxxxxxxxxxx>
> > ---
> >  drmresources.cpp | 4 ++++
> >  drmresources.h   | 1 +
> >  2 files changed, 5 insertions(+)
> > 
> > diff --git a/drmresources.cpp b/drmresources.cpp
> > index 762f5ef..0578cc6 100644
> > --- a/drmresources.cpp
> > +++ b/drmresources.cpp
> > @@ -241,6 +241,10 @@ DrmPlane *DrmResources::GetPlane(uint32_t id)
> > const {
> >    return NULL;
> >  }
> > 
> > +uint32_t DrmResources::GetCrtcCount() const {
> > +  return (uint32_t) crtcs_.size();
> > +}
> 
> The "blessed" way of doing this would be to add a new function
> 
> const std::vector<std::unique_ptr<DrmCrtc>> &crtcs() const {
>   return crtcs_;
> }
> 
> and then use crtcs()->size() wherever needed.
> 
> 

Yeah, that is nicer and more versatile.



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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux