[Libva] [PATCH] dri: Update region's width/height on every PutSurface

Sean V Kelley seanvk at posteo.de
Tue Feb 3 10:09:44 PST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 02/03/2015 08:59 AM, Chris Wilson wrote:
> Currently we expect that if a surface changes size, we will be
> given a new buffer with a new name. This is not always true as the
> ddx may try to keep the same buffer for the client if it is large
> enough for the new size. Since we always know the width/height of
> the buffer, we can pass that information along every time into the
> intel_region struct.

lgtm

Reviewed-by: Sean V Kelley <seanvk at posteo.de>
Tested-by: Sean V Kelley <seanvk at posteo.de>



> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk> Cc: Gwenole
> Beauchesne <gwenole.beauchesne at intel.com> Cc: Dmitry Ermilov
> <dmitry.ermilov at intel.com> --- src/i965_output_dri.c | 30
> ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16
> deletions(-)
> 
> diff --git a/src/i965_output_dri.c b/src/i965_output_dri.c index
> 9bba333..d36fec5 100644 --- a/src/i965_output_dri.c +++
> b/src/i965_output_dri.c @@ -123,7 +123,6 @@ i965_put_surface_dri( 
> union dri_buffer *buffer; struct intel_region *dest_region; struct
> object_surface *obj_surface; -    bool new_region = false; uint32_t
> name; int i, ret;
> 
> @@ -146,27 +145,21 @@ i965_put_surface_dri( assert(buffer);
> 
> dest_region = render_state->draw_region; +    if (dest_region ==
> NULL) { +        dest_region = (struct intel_region *)calloc(1,
> sizeof(*dest_region)); +        assert(dest_region); +
> render_state->draw_region = dest_region; +    }
> 
> -    if (dest_region) { -        assert(dest_region->bo); +    if
> (dest_region->bo) { dri_bo_flink(dest_region->bo, &name); -
>  if (buffer->dri2.name != name) { -            new_region = True; 
> dri_bo_unreference(dest_region->bo); -        } -    } else { -
> dest_region = (struct intel_region *)calloc(1,
> sizeof(*dest_region)); -        assert(dest_region); -
> render_state->draw_region = dest_region; -        new_region =
> True; +	    dest_region->bo = NULL; +	} }
> 
> -    if (new_region) { -        dest_region->x = dri_drawable->x; -
> dest_region->y = dri_drawable->y; -        dest_region->width =
> dri_drawable->width; -        dest_region->height =
> dri_drawable->height; +    if (dest_region->bo == NULL) { 
> dest_region->cpp = buffer->dri2.cpp; dest_region->pitch =
> buffer->dri2.pitch;
> 
> @@ -177,6 +170,11 @@ i965_put_surface_dri( assert(ret == 0); }
> 
> +    dest_region->x = dri_drawable->x; +    dest_region->y =
> dri_drawable->y; +    dest_region->width = dri_drawable->width; +
> dest_region->height = dri_drawable->height; + if (!(flags &
> VA_SRC_COLOR_MASK)) flags |= VA_SRC_BT601;
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJU0Q7dAAoJEGScDsMo8QYOTuoP/icwewDOS0qo/5M9McroF2Hp
cT5VLEj+s4vxmsl/B95EO2JpoXO8G45t+ydXoukQAQC0rjUeIIWCNAMRsva7Qbmh
MuK1lB/Q9XvjxEIAb2JlwKkeA0US5O5D2AOmbIiCz8o9SwOZ2G62U4oaMvsZFros
I7hAqPxQXBZ8ZUs4UjlIWLAn0lEJxnbpDGhxw1CI6T7ji8NALMc9T8GB8HxBcLsI
+kW8gD43+Nhpf6wItz6JFTQu0gS9dc3nuEqjek5/W/Jsz/IUkg3U/AYlSJNO/OaK
tgle2oyHoi5Hh3dF83vri8QjTASwNejkag9wFk1PHtWMBbz6oRgyUtM87irLWzxk
C+sep1mg1KcHENoivAZbdyUZHJHSGm7To4TW/jFh6+bnuWdouCl4L96wQcMICrK7
m4Y3JrRT1AHDflxIjRx0yvmMq59Kzrz2A+ototk1frrNJ0x5oH0t5ebT8YcUpG1W
fOzhz3/7F2AnblZqw0d4jf4OcBYcmfwfb9HqAYGIfzJ2H5l+beK3GHv35qFjZREz
euUdEXkXpXqotKOaJtH/JlW1lATx/BGRxuuHq0n80tfPDwgw3I1oh8Vxkj6mZLtJ
bS6BW8MwQIR760ia4cLq8G2zsaRR1klQqt5lTqt/43I7v3hch5sU7zv5SUTbbQfT
4QQKqPuN7QFYmrh6bRff
=+sVq
-----END PGP SIGNATURE-----


More information about the Libva mailing list