nouveau: use designated initializers
Cc: nouveau@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>main
parent
ae2cf4507c
commit
a9e5880b3e
|
@ -38,7 +38,10 @@ abi16_chan_nv04(struct nouveau_object *obj)
|
||||||
{
|
{
|
||||||
struct nouveau_device *dev = (struct nouveau_device *)obj->parent;
|
struct nouveau_device *dev = (struct nouveau_device *)obj->parent;
|
||||||
struct nv04_fifo *nv04 = obj->data;
|
struct nv04_fifo *nv04 = obj->data;
|
||||||
struct drm_nouveau_channel_alloc req = {nv04->vram, nv04->gart};
|
struct drm_nouveau_channel_alloc req = {
|
||||||
|
.fb_ctxdma_handle = nv04->vram,
|
||||||
|
.tt_ctxdma_handle = nv04->gart
|
||||||
|
};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
|
ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
|
||||||
|
@ -105,7 +108,9 @@ drm_private int
|
||||||
abi16_engobj(struct nouveau_object *obj)
|
abi16_engobj(struct nouveau_object *obj)
|
||||||
{
|
{
|
||||||
struct drm_nouveau_grobj_alloc req = {
|
struct drm_nouveau_grobj_alloc req = {
|
||||||
obj->parent->handle, obj->handle, obj->oclass
|
.channel = obj->parent->handle,
|
||||||
|
.handle = obj->handle,
|
||||||
|
.class = obj->oclass,
|
||||||
};
|
};
|
||||||
struct nouveau_device *dev;
|
struct nouveau_device *dev;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -125,7 +130,9 @@ abi16_ntfy(struct nouveau_object *obj)
|
||||||
{
|
{
|
||||||
struct nv04_notify *ntfy = obj->data;
|
struct nv04_notify *ntfy = obj->data;
|
||||||
struct drm_nouveau_notifierobj_alloc req = {
|
struct drm_nouveau_notifierobj_alloc req = {
|
||||||
obj->parent->handle, ntfy->object->handle, ntfy->length
|
.channel = obj->parent->handle,
|
||||||
|
.handle = ntfy->object->handle,
|
||||||
|
.size = ntfy->length,
|
||||||
};
|
};
|
||||||
struct nouveau_device *dev;
|
struct nouveau_device *dev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -177,7 +177,7 @@ nouveau_device_del(struct nouveau_device **pdev)
|
||||||
int
|
int
|
||||||
nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value)
|
nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value)
|
||||||
{
|
{
|
||||||
struct drm_nouveau_getparam r = { param, 0 };
|
struct drm_nouveau_getparam r = { .param = param };
|
||||||
int fd = dev->fd, ret =
|
int fd = dev->fd, ret =
|
||||||
drmCommandWriteRead(fd, DRM_NOUVEAU_GETPARAM, &r, sizeof(r));
|
drmCommandWriteRead(fd, DRM_NOUVEAU_GETPARAM, &r, sizeof(r));
|
||||||
*value = r.value;
|
*value = r.value;
|
||||||
|
@ -187,7 +187,7 @@ nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value)
|
||||||
int
|
int
|
||||||
nouveau_setparam(struct nouveau_device *dev, uint64_t param, uint64_t value)
|
nouveau_setparam(struct nouveau_device *dev, uint64_t param, uint64_t value)
|
||||||
{
|
{
|
||||||
struct drm_nouveau_setparam r = { param, value };
|
struct drm_nouveau_setparam r = { .param = param, .value = value };
|
||||||
return drmCommandWrite(dev->fd, DRM_NOUVEAU_SETPARAM, &r, sizeof(r));
|
return drmCommandWrite(dev->fd, DRM_NOUVEAU_SETPARAM, &r, sizeof(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ nouveau_bo_del(struct nouveau_bo *bo)
|
||||||
{
|
{
|
||||||
struct nouveau_device_priv *nvdev = nouveau_device(bo->device);
|
struct nouveau_device_priv *nvdev = nouveau_device(bo->device);
|
||||||
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
|
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
|
||||||
struct drm_gem_close req = { bo->handle };
|
struct drm_gem_close req = { .handle = bo->handle };
|
||||||
|
|
||||||
if (nvbo->head.next) {
|
if (nvbo->head.next) {
|
||||||
pthread_mutex_lock(&nvdev->lock);
|
pthread_mutex_lock(&nvdev->lock);
|
||||||
|
|
Loading…
Reference in New Issue