mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
svga: add max DMA size check in svga_winsys_buffer_create()
This fixes a problem when trying to use large (2K x 2K) texture images. We'll DMA the image in chunks. Patch written by Jose.
This commit is contained in:
parent
8c61799051
commit
da2e541218
1 changed files with 10 additions and 0 deletions
|
|
@ -40,6 +40,9 @@
|
|||
#include "svga_debug.h"
|
||||
|
||||
|
||||
#define MAX_DMA_SIZE (8 * 1024 * 1024)
|
||||
|
||||
|
||||
/**
|
||||
* Allocate a winsys_buffer (ie. DMA, aka GMR memory).
|
||||
*
|
||||
|
|
@ -57,6 +60,13 @@ svga_winsys_buffer_create( struct svga_context *svga,
|
|||
struct svga_winsys_screen *sws = svgascreen->sws;
|
||||
struct svga_winsys_buffer *buf;
|
||||
|
||||
/* XXX this shouldn't be a hard-coded number; it should be queried
|
||||
* somehow.
|
||||
*/
|
||||
if (size > MAX_DMA_SIZE) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Just try */
|
||||
buf = sws->buffer_create(sws, alignment, usage, size);
|
||||
if(!buf) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue