sna: Mark redirect proxies with a unique id
This helps gen3 in particular as it uses the unique_id field of a bo to detect changes in render target. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
4f8fba31d7
commit
09862a85eb
|
|
@ -3215,6 +3215,8 @@ gen3_composite_set_target(struct sna *sna,
|
|||
if (op->dst.bo == NULL)
|
||||
return false;
|
||||
|
||||
assert(op->dst.bo->unique_id);
|
||||
|
||||
/* For single-stream mode there should be no minimum alignment
|
||||
* required, except that the width must be at least 2 elements.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1198,7 +1198,7 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
|
|||
}
|
||||
|
||||
/* XXX hopefully a good approximation */
|
||||
static uint32_t kgem_get_unique_id(struct kgem *kgem)
|
||||
uint32_t kgem_get_unique_id(struct kgem *kgem)
|
||||
{
|
||||
uint32_t id;
|
||||
id = ++kgem->unique_id;
|
||||
|
|
|
|||
|
|
@ -249,6 +249,8 @@ unsigned kgem_can_create_2d(struct kgem *kgem, int width, int height, int depth)
|
|||
#define KGEM_CAN_CREATE_LARGE 0x4
|
||||
#define KGEM_CAN_CREATE_GTT 0x8
|
||||
|
||||
uint32_t kgem_get_unique_id(struct kgem *kgem);
|
||||
|
||||
struct kgem_bo *
|
||||
kgem_replace_bo(struct kgem *kgem,
|
||||
struct kgem_bo *src,
|
||||
|
|
|
|||
|
|
@ -1970,6 +1970,7 @@ sna_render_composite_redirect(struct sna *sna,
|
|||
}
|
||||
|
||||
assert(op->dst.bo != t->real_bo);
|
||||
op->dst.bo->unique_id = kgem_unique_id(&sna->kgem);
|
||||
op->dst.bo->pitch = t->real_bo->pitch;
|
||||
|
||||
op->dst.x -= box.x1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue