aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov2015-08-15 12:01:53 -0500
committerEmil Velikov2015-09-04 15:39:06 -0500
commita9e5880b3e93f2fc981c910d16a9eab2ca81c7a0 (patch)
tree01887c77f76c6168db8e923bdd77710c037bc18f /nouveau
parentae2cf4507c32f0e16fdb41472ac68d72bfb007ac (diff)
downloadexternal-libgbm-a9e5880b3e93f2fc981c910d16a9eab2ca81c7a0.tar.gz
external-libgbm-a9e5880b3e93f2fc981c910d16a9eab2ca81c7a0.tar.xz
external-libgbm-a9e5880b3e93f2fc981c910d16a9eab2ca81c7a0.zip
nouveau: use designated initializers
Cc: nouveau@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/abi16.c13
-rw-r--r--nouveau/nouveau.c6
2 files changed, 13 insertions, 6 deletions
diff --git a/nouveau/abi16.c b/nouveau/abi16.c
index 4ca0bfba..59bc4360 100644
--- a/nouveau/abi16.c
+++ b/nouveau/abi16.c
@@ -38,7 +38,10 @@ abi16_chan_nv04(struct nouveau_object *obj)
38{ 38{
39 struct nouveau_device *dev = (struct nouveau_device *)obj->parent; 39 struct nouveau_device *dev = (struct nouveau_device *)obj->parent;
40 struct nv04_fifo *nv04 = obj->data; 40 struct nv04_fifo *nv04 = obj->data;
41 struct drm_nouveau_channel_alloc req = {nv04->vram, nv04->gart}; 41 struct drm_nouveau_channel_alloc req = {
42 .fb_ctxdma_handle = nv04->vram,
43 .tt_ctxdma_handle = nv04->gart
44 };
42 int ret; 45 int ret;
43 46
44 ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC, 47 ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
@@ -105,7 +108,9 @@ drm_private int
105abi16_engobj(struct nouveau_object *obj) 108abi16_engobj(struct nouveau_object *obj)
106{ 109{
107 struct drm_nouveau_grobj_alloc req = { 110 struct drm_nouveau_grobj_alloc req = {
108 obj->parent->handle, obj->handle, obj->oclass 111 .channel = obj->parent->handle,
112 .handle = obj->handle,
113 .class = obj->oclass,
109 }; 114 };
110 struct nouveau_device *dev; 115 struct nouveau_device *dev;
111 int ret; 116 int ret;
@@ -125,7 +130,9 @@ abi16_ntfy(struct nouveau_object *obj)
125{ 130{
126 struct nv04_notify *ntfy = obj->data; 131 struct nv04_notify *ntfy = obj->data;
127 struct drm_nouveau_notifierobj_alloc req = { 132 struct drm_nouveau_notifierobj_alloc req = {
128 obj->parent->handle, ntfy->object->handle, ntfy->length 133 .channel = obj->parent->handle,
134 .handle = ntfy->object->handle,
135 .size = ntfy->length,
129 }; 136 };
130 struct nouveau_device *dev; 137 struct nouveau_device *dev;
131 int ret; 138 int ret;
diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index 7393474d..97fd77b9 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -177,7 +177,7 @@ nouveau_device_del(struct nouveau_device **pdev)
177int 177int
178nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value) 178nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value)
179{ 179{
180 struct drm_nouveau_getparam r = { param, 0 }; 180 struct drm_nouveau_getparam r = { .param = param };
181 int fd = dev->fd, ret = 181 int fd = dev->fd, ret =
182 drmCommandWriteRead(fd, DRM_NOUVEAU_GETPARAM, &r, sizeof(r)); 182 drmCommandWriteRead(fd, DRM_NOUVEAU_GETPARAM, &r, sizeof(r));
183 *value = r.value; 183 *value = r.value;
@@ -187,7 +187,7 @@ nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value)
187int 187int
188nouveau_setparam(struct nouveau_device *dev, uint64_t param, uint64_t value) 188nouveau_setparam(struct nouveau_device *dev, uint64_t param, uint64_t value)
189{ 189{
190 struct drm_nouveau_setparam r = { param, value }; 190 struct drm_nouveau_setparam r = { .param = param, .value = value };
191 return drmCommandWrite(dev->fd, DRM_NOUVEAU_SETPARAM, &r, sizeof(r)); 191 return drmCommandWrite(dev->fd, DRM_NOUVEAU_SETPARAM, &r, sizeof(r));
192} 192}
193 193
@@ -348,7 +348,7 @@ nouveau_bo_del(struct nouveau_bo *bo)
348{ 348{
349 struct nouveau_device_priv *nvdev = nouveau_device(bo->device); 349 struct nouveau_device_priv *nvdev = nouveau_device(bo->device);
350 struct nouveau_bo_priv *nvbo = nouveau_bo(bo); 350 struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
351 struct drm_gem_close req = { bo->handle }; 351 struct drm_gem_close req = { .handle = bo->handle };
352 352
353 if (nvbo->head.next) { 353 if (nvbo->head.next) {
354 pthread_mutex_lock(&nvdev->lock); 354 pthread_mutex_lock(&nvdev->lock);