aboutsummaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-05-30 12:14:44 +1000
committerDave Airlie <airlied@redhat.com>2008-05-30 12:14:44 +1000
commitfae2c17b313e2838652c32ea4a576172b4063639 (patch)
treec977a5519b42884e2dcefeaaecb0a45942f304bd /libdrm
parent16a8f824face8067029ef6f3d10f1723d87b23f6 (diff)
drm: add more encoder interfaces
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drmMode.c8
-rw-r--r--libdrm/xf86drmMode.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index e5798f96..672a5e2a 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -381,6 +381,8 @@ drmModeOutputPtr drmModeGetOutput(int fd, uint32_t output_id)
out.count_props = 0;
out.props_ptr = 0;
out.prop_values_ptr = 0;
+ out.count_encoders = 0;
+ out.encoders_ptr = 0;
if (ioctl(fd, DRM_IOCTL_MODE_GETOUTPUT, &out))
return 0;
@@ -393,6 +395,9 @@ drmModeOutputPtr drmModeGetOutput(int fd, uint32_t output_id)
if (out.count_modes)
out.modes_ptr = VOID2U64(drmMalloc(out.count_modes*sizeof(struct drm_mode_modeinfo)));
+ if (out.count_encoders)
+ out.encoders_ptr = VOID2U64(drmMalloc(out.count_encoders*sizeof(uint32_t)));
+
if (ioctl(fd, DRM_IOCTL_MODE_GETOUTPUT, &out))
goto err_allocs;
@@ -416,6 +421,8 @@ drmModeOutputPtr drmModeGetOutput(int fd, uint32_t output_id)
r->props = drmAllocCpy(U642VOID(out.props_ptr), out.count_props, sizeof(uint32_t));
r->prop_values = drmAllocCpy(U642VOID(out.prop_values_ptr), out.count_props, sizeof(uint64_t));
r->modes = drmAllocCpy(U642VOID(out.modes_ptr), out.count_modes, sizeof(struct drm_mode_modeinfo));
+ r->count_encoders = out.count_encoders;
+ r->encoders = drmAllocCpy(U642VOID(out.encoders_ptr), out.count_encoders, sizeof(uint32_t));
r->output_type = out.output_type;
r->output_type_id = out.output_type_id;
@@ -423,6 +430,7 @@ err_allocs:
drmFree(U642VOID(out.prop_values_ptr));
drmFree(U642VOID(out.props_ptr));
drmFree(U642VOID(out.modes_ptr));
+ drmFree(U642VOID(out.encoders_ptr));
return r;
}
diff --git a/libdrm/xf86drmMode.h b/libdrm/xf86drmMode.h
index a5ecd099..601a6460 100644
--- a/libdrm/xf86drmMode.h
+++ b/libdrm/xf86drmMode.h
@@ -154,6 +154,8 @@ typedef struct _drmModeOutput {
uint32_t *props; /**< List of property ids */
uint64_t *prop_values; /**< List of property values */
+ int count_encoders;
+ uint32_t *encoders; /**< List of encoder ids */
} drmModeOutput, *drmModeOutputPtr;