]> git.baikalelectronics.ru Git - kernel.git/commit
drm/radeon: validate relocations in the order determined by userspace v3
authorMarek Olšák <marek.olsak@amd.com>
Sat, 1 Mar 2014 23:56:21 +0000 (00:56 +0100)
committerChristian König <christian.koenig@amd.com>
Mon, 3 Mar 2014 09:57:19 +0000 (10:57 +0100)
commitf563a7299e589daf71bf35d87eabeccd5de70482
treee7be2b702803f238bfa5e4406fa9ed8e70f9351f
parentc61ff51d97cdcb62cbf3299d8c177096801bace7
drm/radeon: validate relocations in the order determined by userspace v3

Userspace should set the first 4 bits of drm_radeon_cs_reloc::flags to
a number from 0 to 15. The higher the number, the higher the priority,
which means a buffer with a higher number will be validated sooner.

The old behavior is preserved: Buffers used for write are prioritized over
read-only buffers if the userspace doesn't set the number.

v2: add buffers to buckets directly, then concatenate them
v3: use a stable sort

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_cs.c
drivers/gpu/drm/radeon/radeon_object.c
drivers/gpu/drm/radeon/radeon_object.h