[Mesa-dev] [PATCH v2 3/4] gallium/winsys/kms: Move display target handle lookup to separate function (v2)

Tomasz Figa tfiga at chromium.org
Mon Aug 8 08:55:18 UTC 2016


On Fri, Aug 5, 2016 at 2:37 AM, Jordan Justen <jordan.l.justen at intel.com>
wrote:

> On 2016-08-02 03:46:27, Tomasz Figa wrote:
> > As a preparation to use the lookup in more than once place, move the
> > code that looks up given KMS/GEM handle to a separate function. This
> > change should not introduce any functional changes.
> >
> > v2: Split into separate patch.
> >     Move lookup code into separate function.
> >
> > Signed-off-by: Tomasz Figa <tfiga at chromium.org>
> > CC: <mesa-stable at lists.freedesktop.org>
> > ---
> >  src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 33
> ++++++++++++++++-------
> >  1 file changed, 24 insertions(+), 9 deletions(-)
> >
> > diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
> b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
> > index 65dbf70..cb02b22 100644
> > --- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
> > +++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
> > @@ -211,6 +211,26 @@ kms_sw_displaytarget_map(struct sw_winsys *ws,
> >  }
> >
> >  static struct kms_sw_displaytarget *
> > +kms_sw_displaytarget_lookup(struct kms_sw_winsys *kms_sw,
> > +                            unsigned int kms_handle)
>
> I don't think the 'lookup' name is appropriate, since it has the
> ref-count side effect. Instead of 'lookup', how about import, or
> find_and_import or something similar?
>

How about "get_by_handle"? IMHO "import" is kind of confusing, because the
function doesn't end up creating any new objects, but instead just looks
through already known ones. "Get" seems to be a reasonably common word for
getting a reference on an object (together with "put" for dropping the
reference).

Best regards,
Tomasz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160808/e72bbf99/attachment.html>


More information about the mesa-dev mailing list