modesetting: remove alloca usage again
this slipped back in. Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
f8eb8c1cb4
commit
e47ad8a0ae
|
@ -428,10 +428,13 @@ static int dispatch_dirty_region(ScrnInfoPtr scrn,
|
||||||
unsigned num_cliprects = REGION_NUM_RECTS(dirty);
|
unsigned num_cliprects = REGION_NUM_RECTS(dirty);
|
||||||
|
|
||||||
if (num_cliprects) {
|
if (num_cliprects) {
|
||||||
drmModeClip *clip = alloca(num_cliprects * sizeof(drmModeClip));
|
drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip));
|
||||||
BoxPtr rect = REGION_RECTS(dirty);
|
BoxPtr rect = REGION_RECTS(dirty);
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
|
if (!clip)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
/* XXX no need for copy? */
|
/* XXX no need for copy? */
|
||||||
for (i = 0; i < num_cliprects; i++, rect++) {
|
for (i = 0; i < num_cliprects; i++, rect++) {
|
||||||
clip[i].x1 = rect->x1;
|
clip[i].x1 = rect->x1;
|
||||||
|
@ -442,6 +445,7 @@ static int dispatch_dirty_region(ScrnInfoPtr scrn,
|
||||||
|
|
||||||
/* TODO query connector property to see if this is needed */
|
/* TODO query connector property to see if this is needed */
|
||||||
ret = drmModeDirtyFB(ms->fd, fb_id, clip, num_cliprects);
|
ret = drmModeDirtyFB(ms->fd, fb_id, clip, num_cliprects);
|
||||||
|
free(clip);
|
||||||
DamageEmpty(damage);
|
DamageEmpty(damage);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (ret == -EINVAL)
|
if (ret == -EINVAL)
|
||||||
|
|
Loading…
Reference in New Issue