Lines Matching defs:res

156 	struct drm_mode_card_res res = {0};
158 if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res) != 0)
161 return res.count_crtcs > 0 && res.count_connectors > 0 && res.count_encoders > 0;
166 struct drm_mode_card_res res, counts;
170 memclear(res);
171 if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res))
174 counts = res;
176 if (res.count_fbs) {
177 res.fb_id_ptr = VOID2U64(drmMalloc(res.count_fbs*sizeof(uint32_t)));
178 if (!res.fb_id_ptr)
181 if (res.count_crtcs) {
182 res.crtc_id_ptr = VOID2U64(drmMalloc(res.count_crtcs*sizeof(uint32_t)));
183 if (!res.crtc_id_ptr)
186 if (res.count_connectors) {
187 res.connector_id_ptr = VOID2U64(drmMalloc(res.count_connectors*sizeof(uint32_t)));
188 if (!res.connector_id_ptr)
191 if (res.count_encoders) {
192 res.encoder_id_ptr = VOID2U64(drmMalloc(res.count_encoders*sizeof(uint32_t)));
193 if (!res.encoder_id_ptr)
197 if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res))
204 if (counts.count_fbs < res.count_fbs ||
205 counts.count_crtcs < res.count_crtcs ||
206 counts.count_connectors < res.count_connectors ||
207 counts.count_encoders < res.count_encoders)
209 drmFree(U642VOID(res.fb_id_ptr));
210 drmFree(U642VOID(res.crtc_id_ptr));
211 drmFree(U642VOID(res.connector_id_ptr));
212 drmFree(U642VOID(res.encoder_id_ptr));
223 r->min_width = res.min_width;
224 r->max_width = res.max_width;
225 r->min_height = res.min_height;
226 r->max_height = res.max_height;
227 r->count_fbs = res.count_fbs;
228 r->count_crtcs = res.count_crtcs;
229 r->count_connectors = res.count_connectors;
230 r->count_encoders = res.count_encoders;
232 r->fbs = drmAllocCpy(U642VOID(res.fb_id_ptr), res.count_fbs, sizeof(uint32_t));
233 r->crtcs = drmAllocCpy(U642VOID(res.crtc_id_ptr), res.count_crtcs, sizeof(uint32_t));
234 r->connectors = drmAllocCpy(U642VOID(res.connector_id_ptr), res.count_connectors, sizeof(uint32_t));
235 r->encoders = drmAllocCpy(U642VOID(res.encoder_id_ptr), res.count_encoders, sizeof(uint32_t));
236 if ((res.count_fbs && !r->fbs) ||
237 (res.count_crtcs && !r->crtcs) ||
238 (res.count_connectors && !r->connectors) ||
239 (res.count_encoders && !r->encoders))
250 drmFree(U642VOID(res.fb_id_ptr));
251 drmFree(U642VOID(res.crtc_id_ptr));
252 drmFree(U642VOID(res.connector_id_ptr));
253 drmFree(U642VOID(res.encoder_id_ptr));
615 struct drm_mode_mode_cmd res;
617 memclear(res);
618 memcpy(&res.mode, mode_info, sizeof(struct drm_mode_modeinfo));
619 res.connector_id = connector_id;
621 return DRM_IOCTL(fd, DRM_IOCTL_MODE_ATTACHMODE, &res);
626 struct drm_mode_mode_cmd res;
628 memclear(res);
629 memcpy(&res.mode, mode_info, sizeof(struct drm_mode_modeinfo));
630 res.connector_id = connector_id;
632 return DRM_IOCTL(fd, DRM_IOCTL_MODE_DETACHMODE, &res);
948 struct drm_mode_card_res res;
954 memset(&res, 0, sizeof(struct drm_mode_card_res));
956 if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res)) {
1185 struct drm_mode_get_plane_res res, counts;
1189 memclear(res);
1190 if (drmIoctl(fd, DRM_IOCTL_MODE_GETPLANERESOURCES, &res))
1193 counts = res;
1195 if (res.count_planes) {
1196 res.plane_id_ptr = VOID2U64(drmMalloc(res.count_planes *
1198 if (!res.plane_id_ptr)
1202 if (drmIoctl(fd, DRM_IOCTL_MODE_GETPLANERESOURCES, &res))
1205 if (counts.count_planes < res.count_planes) {
1206 drmFree(U642VOID(res.plane_id_ptr));
1213 r->count_planes = res.count_planes;
1214 r->planes = drmAllocCpy(U642VOID(res.plane_id_ptr),
1215 res.count_planes, sizeof(uint32_t));
1216 if (res.count_planes && !r->planes) {
1223 drmFree(U642VOID(res.plane_id_ptr));