]> git.baikalelectronics.ru Git - kernel.git/commit
drm/radeon: command stream checker for r3xx-r5xx hardware
authorJerome Glisse <glisse@freedesktop.org>
Wed, 17 Jun 2009 11:28:30 +0000 (13:28 +0200)
committerDave Airlie <airlied@redhat.com>
Thu, 18 Jun 2009 23:32:27 +0000 (09:32 +1000)
commit3a2d002e7c472bc50aaba89cf58b5eb7411cced2
treee1038db118114aa777312a5eae70b512fa13617b
parentbd77da5a7c960d5e001bfe270799f60a38bfb384
drm/radeon: command stream checker for r3xx-r5xx hardware

For security purpose we want to make sure the userspace process doesn't
access memory beyond buffer it owns. To achieve this we need to check
states the userspace program. For color buffer and zbuffer we check that
the clipping register will discard access beyond buffers set as color
or zbuffer. For vertex buffer we check that no vertex fetch will happen
beyond buffer end. For texture we check various texture states (number
of mipmap level, texture size, texture depth, ...) to compute the amount
of memory the texture fetcher might access.

The command stream checking impact the performances so far quick benchmark
shows an average of 3% decrease in fps of various applications. It can
be optimized a bit more by caching result of checking and thus avoid a
full recheck if no states changed since last check.

Note that this patch is still incomplete on checking side as it doesn't
check 2d rendering states.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/r300.h [new file with mode: 0644]
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_asic.h
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/rv515.c