mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-05 18:18:27 +02:00
drm: fix a couple of bugs in the encoder return to userspace
This commit is contained in:
parent
9239cf511f
commit
1c4b25a2b1
1 changed files with 4 additions and 0 deletions
|
|
@ -167,6 +167,7 @@ drmModeResPtr drmModeGetResources(int fd)
|
|||
r->count_fbs = res.count_fbs;
|
||||
r->count_crtcs = res.count_crtcs;
|
||||
r->count_outputs = res.count_outputs;
|
||||
r->count_encoders = res.count_encoders;
|
||||
/* TODO we realy should test if these allocs fails. */
|
||||
r->fbs = drmAllocCpy(U642VOID(res.fb_id_ptr), res.count_fbs, sizeof(uint32_t));
|
||||
r->crtcs = drmAllocCpy(U642VOID(res.crtc_id_ptr), res.count_crtcs, sizeof(uint32_t));
|
||||
|
|
@ -358,6 +359,9 @@ drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id)
|
|||
if (ioctl(fd, DRM_IOCTL_MODE_GETENCODER, &enc))
|
||||
return 0;
|
||||
|
||||
if (!(r = drmMalloc(sizeof(*r))))
|
||||
return 0;
|
||||
|
||||
r->encoder_type = enc.encoder_type;
|
||||
r->crtcs = enc.crtcs;
|
||||
r->clones = enc.clones;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue