From patchwork Mon Aug 24 16:34:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 7065651 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 80E4F9F358 for ; Mon, 24 Aug 2015 16:30:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 284AD20787 for ; Mon, 24 Aug 2015 16:30:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5095C20784 for ; Mon, 24 Aug 2015 16:30:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED30172092; Mon, 24 Aug 2015 09:30:26 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51B546E9F8; Mon, 24 Aug 2015 09:30:22 -0700 (PDT) Received: by wicja10 with SMTP id ja10so77273831wic.1; Mon, 24 Aug 2015 09:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=U34zQ5bikT/RXJEuPnXzOXgVphiJNc6nTNT4cwecwMo=; b=oqWxkff9QhL/6Jwna2yJlh0mCNK7nwancnzXgtMgGwD+dajpCM94TunU7DYLULsROB XHkmGVYLtyXFPZVOWhQB2GYiBsdVpZuOViUrNw2EkFX7o1e0R93OadaYkoDuIjMRBVj6 EOiWxZWxOW42N3hOgvp4sX/f1FAE2W3Fe3uCWwS2tUmJUm+DHmmGCkEGLTRPFmt+dEDa efZr5Ii1/Kjys451c8M4uPz09ZNXTfdNnodlWoAo1dVK9d2XWAYup3wXWJ46QTUZSQrh vIrRS+Yt22E/AA4rUe5CYupZKGFFoW5xeggPZu14l7CfHSMdxQtfHQKVJHW/+WE0y8hH i4Cw== X-Received: by 10.194.122.97 with SMTP id lr1mr41838926wjb.26.1440433820962; Mon, 24 Aug 2015 09:30:20 -0700 (PDT) Received: from arch-x220.localdomain (cpc12-croy20-2-0-cust52.croy.cable.virginm.net. [82.44.54.53]) by smtp.gmail.com with ESMTPSA id ll1sm16885984wic.14.2015.08.24.09.30.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Aug 2015 09:30:20 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 15/17] nouveau: use designated initializers Date: Mon, 24 Aug 2015 17:34:18 +0100 Message-Id: <1440434060-31347-15-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1440434060-31347-1-git-send-email-emil.l.velikov@gmail.com> References: <1440434060-31347-1-git-send-email-emil.l.velikov@gmail.com> Cc: nouveau@lists.freedesktop.org, emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: nouveau@lists.freedesktop.org Signed-off-by: Emil Velikov --- nouveau/abi16.c | 13 ++++++++++--- nouveau/nouveau.c | 6 +++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/nouveau/abi16.c b/nouveau/abi16.c index 4ca0bfb..59bc436 100644 --- a/nouveau/abi16.c +++ b/nouveau/abi16.c @@ -38,7 +38,10 @@ abi16_chan_nv04(struct nouveau_object *obj) { struct nouveau_device *dev = (struct nouveau_device *)obj->parent; 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; ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC, @@ -105,7 +108,9 @@ drm_private int abi16_engobj(struct nouveau_object *obj) { 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; int ret; @@ -125,7 +130,9 @@ abi16_ntfy(struct nouveau_object *obj) { struct nv04_notify *ntfy = obj->data; 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; int ret; diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index 7393474..97fd77b 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -177,7 +177,7 @@ nouveau_device_del(struct nouveau_device **pdev) int 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 = drmCommandWriteRead(fd, DRM_NOUVEAU_GETPARAM, &r, sizeof(r)); *value = r.value; @@ -187,7 +187,7 @@ nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value) int 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)); } @@ -348,7 +348,7 @@ nouveau_bo_del(struct nouveau_bo *bo) { struct nouveau_device_priv *nvdev = nouveau_device(bo->device); 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) { pthread_mutex_lock(&nvdev->lock);