<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 5, 2016 at 2:37 AM, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2016-08-02 03:46:27, Tomasz Figa wrote:<br>
> As a preparation to use the lookup in more than once place, move the<br>
> code that looks up given KMS/GEM handle to a separate function. This<br>
> change should not introduce any functional changes.<br>
><br>
> v2: Split into separate patch.<br>
> Move lookup code into separate function.<br>
><br>
> Signed-off-by: Tomasz Figa <<a href="mailto:tfiga@chromium.org">tfiga@chromium.org</a>><br>
> CC: <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.<wbr>freedesktop.org</a>><br>
> ---<br>
> src/gallium/winsys/sw/kms-dri/<wbr>kms_dri_sw_winsys.c | 33 ++++++++++++++++-------<br>
> 1 file changed, 24 insertions(+), 9 deletions(-)<br>
><br>
> diff --git a/src/gallium/winsys/sw/kms-<wbr>dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-<wbr>dri/kms_dri_sw_winsys.c<br>
> index 65dbf70..cb02b22 100644<br>
> --- a/src/gallium/winsys/sw/kms-<wbr>dri/kms_dri_sw_winsys.c<br>
> +++ b/src/gallium/winsys/sw/kms-<wbr>dri/kms_dri_sw_winsys.c<br>
> @@ -211,6 +211,26 @@ kms_sw_displaytarget_map(<wbr>struct sw_winsys *ws,<br>
> }<br>
><br>
> static struct kms_sw_displaytarget *<br>
> +kms_sw_displaytarget_lookup(<wbr>struct kms_sw_winsys *kms_sw,<br>
> + unsigned int kms_handle)<br>
<br>
</span>I don't think the 'lookup' name is appropriate, since it has the<br>
ref-count side effect. Instead of 'lookup', how about import, or<br>
find_and_import or something similar?<br></blockquote><div><br></div><div>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).</div><div><br></div><div>Best regards,</div><div>Tomasz</div><div><br></div></div></div></div>