[Mesa-dev] [PATCH v3 10/11] vc4: use common screen ref counting

Eric Anholt eric at anholt.net
Wed Jul 20 23:31:46 UTC 2016


Rob Herring <robh at kernel.org> writes:

> Use the common pipe_screen ref counting and fd hashing functions. The
> mutex can be dropped as the pipe loader protects the create_screen()
> calls.

I think the mutex mention in the commit message is copy-and-paste from
another commit, since there's no mutex present in this code before.

> Cc: Eric Anholt <eric at anholt.net>
> Signed-off-by: Rob Herring <robh at kernel.org>
> ---
>  src/gallium/winsys/vc4/drm/vc4_drm_winsys.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c b/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
> index c5434ad..acda743 100644
> --- a/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
> +++ b/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
> @@ -22,6 +22,7 @@
>   */
>  
>  #include <unistd.h>
> +#include "util/u_screen.h"
>  
>  #include "vc4_drm_public.h"
>  
> @@ -30,5 +31,11 @@
>  struct pipe_screen *
>  vc4_drm_screen_create(int fd)
>  {
> -	return vc4_screen_create(dup(fd));
> +        struct pipe_screen *pscreen = pipe_screen_reference(fd);
> +        if (pscreen)
> +            return pscreen;
> +
> +	pscreen = vc4_screen_create(dup(fd));
> +	pipe_screen_reference_init(pscreen, fd);
> +	return pscreen;
>  }

Some inconsistent whitespace, but I don't care much about
vc4_drm_winsys.c.

With commit message cleaned up somehow,

Acked-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160720/2095d562/attachment.sig>


More information about the mesa-dev mailing list