st/nine: Bind src not dst in nine_context_box_upload

nine_context_box_upload uploads a ram buffer (from src)
to a pipe_resource (dst).
We already have a refcount on the pipe_resource,
what needs to be protected from release is the ram buffer,
thus a reference to src.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 42d672fa6a)
This commit is contained in:
Axel Davy 2018-12-03 21:15:47 +01:00 committed by Emil Velikov
parent df3fd9f738
commit bf6f68fc83
4 changed files with 6 additions and 6 deletions

View file

@ -2429,7 +2429,7 @@ CSMT_ITEM_NO_WAIT_WITH_COUNTER(nine_context_range_upload,
}
CSMT_ITEM_NO_WAIT_WITH_COUNTER(nine_context_box_upload,
ARG_BIND_REF(struct NineUnknown, dst),
ARG_BIND_REF(struct NineUnknown, src_ref),
ARG_BIND_RES(struct pipe_resource, res),
ARG_VAL(unsigned, level),
ARG_COPY_REF(struct pipe_box, dst_box),
@ -2444,8 +2444,8 @@ CSMT_ITEM_NO_WAIT_WITH_COUNTER(nine_context_box_upload,
struct pipe_transfer *transfer = NULL;
uint8_t *map;
/* We just bind dst for the bind count */
(void)dst;
/* Binding src_ref avoids release before upload */
(void)src_ref;
map = pipe->transfer_map(pipe,
res,

View file

@ -568,7 +568,7 @@ nine_context_range_upload(struct NineDevice9 *device,
void
nine_context_box_upload(struct NineDevice9 *device,
unsigned *counter,
struct NineUnknown *dst,
struct NineUnknown *src_ref,
struct pipe_resource *res,
unsigned level,
const struct pipe_box *dst_box,

View file

@ -660,7 +660,7 @@ NineSurface9_CopyMemToDefault( struct NineSurface9 *This,
nine_context_box_upload(This->base.base.device,
&From->pending_uploads_counter,
(struct NineUnknown *)This,
(struct NineUnknown *)From,
r_dst,
This->level,
&dst_box,

View file

@ -449,7 +449,7 @@ NineVolume9_CopyMemToDefault( struct NineVolume9 *This,
nine_context_box_upload(This->base.device,
&From->pending_uploads_counter,
(struct NineUnknown *)This,
(struct NineUnknown *)From,
r_dst,
This->level,
&dst_box,