summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-07-09 14:53:47 +1000
committerDave Airlie <airlied@redhat.com>2008-07-09 14:53:47 +1000
commit2556341f8baf0e0b7b5f7843135e43e662751af0 (patch)
tree84b591787aa036959e56c490b38dbf9e191c76dd /libdrm
parent38a5f6686cd38d5204e240f30006538bcf70f5ac (diff)
parent0b7d9a97bd2383fe4382fc1b1b266542020f0c4e (diff)
Merge remote branch 'origin/modesetting-101' into modesetting-gem
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drmMode.c26
-rw-r--r--libdrm/xf86drmMode.h29
2 files changed, 18 insertions, 37 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index a393f965..c3921ee9 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -284,11 +284,6 @@ int drmModeSetCrtc(int fd, uint32_t crtcId, uint32_t bufferId,
{
struct drm_mode_crtc crtc;
- crtc.count_connectors = 0;
- crtc.connectors = 0;
- crtc.count_possibles = 0;
- crtc.possibles = 0;
-
crtc.x = x;
crtc.y = y;
crtc.crtc_id = crtcId;
@@ -343,8 +338,8 @@ drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id)
enc.encoder_id = encoder_id;
enc.encoder_type = 0;
- enc.crtcs = 0;
- enc.clones = 0;
+ enc.possible_crtcs = 0;
+ enc.possible_clones = 0;
if (ioctl(fd, DRM_IOCTL_MODE_GETENCODER, &enc))
return 0;
@@ -353,10 +348,10 @@ drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id)
return 0;
r->encoder_id = enc.encoder_id;
- r->crtc = enc.crtc;
+ r->crtc_id = enc.crtc_id;
r->encoder_type = enc.encoder_type;
- r->crtcs = enc.crtcs;
- r->clones = enc.clones;
+ r->possible_crtcs = enc.possible_crtcs;
+ r->possible_clones = enc.possible_clones;
return r;
}
@@ -370,7 +365,7 @@ drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connector_id)
struct drm_mode_get_connector conn;
drmModeConnectorPtr r = NULL;
- conn.connector = connector_id;
+ conn.connector_id = connector_id;
conn.connector_type_id = 0;
conn.connector_type = 0;
conn.count_modes = 0;
@@ -402,8 +397,8 @@ drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connector_id)
goto err_allocs;
}
- r->connector_id = conn.connector;
- r->encoder = conn.encoder;
+ r->connector_id = conn.connector_id;
+ r->encoder_id = conn.encoder_id;
r->connection = conn.connection;
r->mmWidth = conn.mm_width;
r->mmHeight = conn.mm_height;
@@ -419,6 +414,9 @@ drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connector_id)
r->connector_type = conn.connector_type;
r->connector_type_id = conn.connector_type_id;
+ if (!r->props || !r->prop_values || !r->modes || !r->encoders)
+ goto err_allocs;
+
err_allocs:
drmFree(U642VOID(conn.prop_values_ptr));
drmFree(U642VOID(conn.props_ptr));
@@ -492,7 +490,7 @@ drmModePropertyPtr drmModeGetProperty(int fd, uint32_t property_id)
if (prop.flags & DRM_MODE_PROP_ENUM) {
r->count_enums = prop.count_enum_blobs;
r->enums = drmAllocCpy(U642VOID(prop.enum_blob_ptr), prop.count_enum_blobs, sizeof(struct drm_mode_property_enum));
- } else if (prop.flags & DRM_MODE_PROP_ENUM) {
+ } else if (prop.flags & DRM_MODE_PROP_BLOB) {
r->values = drmAllocCpy(U642VOID(prop.values_ptr), prop.count_enum_blobs, sizeof(uint32_t));
r->blob_ids = drmAllocCpy(U642VOID(prop.enum_blob_ptr), prop.count_enum_blobs, sizeof(uint32_t));
r->count_blobs = prop.count_enum_blobs;
diff --git a/libdrm/xf86drmMode.h b/libdrm/xf86drmMode.h
index f1b7c86e..59612a94 100644
--- a/libdrm/xf86drmMode.h
+++ b/libdrm/xf86drmMode.h
@@ -50,16 +50,8 @@
* buffer object interface. This object needs to be pinned.
*/
-/*
- * generation - these are to be read by userspace, and if it notices
- * while calling a get output or get crtc that the generation has changed
- * it should re-call the mode resource functions resync its view of the
- * outputs with current view.
- */
-
typedef struct _drmModeRes {
- uint32_t generation;
int count_fbs;
uint32_t *fbs;
@@ -98,31 +90,23 @@ typedef struct _drmModeProperty {
typedef struct _drmModeCrtc {
unsigned int crtc_id;
- unsigned int buffer_id; /**< FB id to connect to 0 = disconnect*/
- uint32_t generation;
+ unsigned int buffer_id; /**< FB id to connect to 0 = disconnect */
- uint32_t x, y; /**< Position on the frameuffer */
+ uint32_t x, y; /**< Position on the framebuffer */
uint32_t width, height;
int mode_valid;
struct drm_mode_modeinfo mode;
- int count_connectors;
- uint32_t connectors; /**< Connectors that are connected */
-
- int count_possibles;
- uint32_t possibles; /**< Connectors that can be connected */
-
int gamma_size; /**< Number of gamma stops */
} drmModeCrtc, *drmModeCrtcPtr;
typedef struct _drmModeEncoder {
- uint32_t generation;
unsigned int encoder_id;
unsigned int encoder_type;
- uint32_t crtc;
- uint32_t crtcs;
- uint32_t clones;
+ unsigned int crtc_id;
+ uint32_t possible_crtcs;
+ uint32_t possible_clones;
} drmModeEncoder, *drmModeEncoderPtr;
typedef enum {
@@ -141,9 +125,8 @@ typedef enum {
} drmModeSubPixel;
typedef struct _drmModeConnector {
- uint32_t generation;
unsigned int connector_id;
- unsigned int encoder; /**< Crtc currently connected to */
+ unsigned int encoder_id; /**< Encoder currently connected to */
unsigned int connector_type;
unsigned int connector_type_id;
drmModeConnection connection;