From patchwork Mon Oct 2 11:12:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 147237 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1350214vqb; Mon, 2 Oct 2023 04:16:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHHAyctZ/uR0ruf5B4EEiqASo/Wx+F6bY03PBIRX7H0HVNUShdDbCXMDYd5309a9ucQVEY X-Received: by 2002:a05:6870:e2cd:b0:1bb:6792:4787 with SMTP id w13-20020a056870e2cd00b001bb67924787mr12809044oad.40.1696245393393; Mon, 02 Oct 2023 04:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696245393; cv=none; d=google.com; s=arc-20160816; b=kbYM8NaxKjmjZmGlajoMso5Z54uDlN2xCc+ThOfCgMyw3CDfezJF380K2nYQ3XPYgC LPbHJKxCO2rd/XTekw746VOsW5raejLq1+L07ZJviVuqpsPgzEmyqV8RVj2eD/Sohdml +XR3N4RQV2u+LuI7TuADDpiI+ndxeY/wa1RoxAosmOU6N0zN9hAJ3IH4bcIuComhAf85 W3/Jsbiq8Ix5oQkqMc6VrZoENB9RfDlNNHPj+w4jGhAYZBe3MqNFtxPlHxirRxIFAf+K LAiMFLMaGNOBGOwd/ZuDdwtf2Ta2y3XD9KyhhRjeuTc789PF2xmB+iQR3741K5joow1Z ZIkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=uxjkEWMlkYIbcf9Txh5FXpiuvSthHRvhaHXOyzFdmxM=; fh=zB/Le29j84eF2EWMM5mMCmgRJzHNI4kLocpkF47EhQo=; b=fViDirTsY+0ogzriIO22yBFUcPQy9fmw6LKppNIjzvC/7tovb0T+RoLV6j0HNBQ9vN 9RhWWgNDkifvCaG/Cs41mr0Dv0Z60wtnKZZH+JSw7E10PbqMYyTRr+A/E85xqi8UIeGw saj3OjlvpUYcV+8uBkZkh4X7PJvlddAQM6ktOEmwhcuow5zV3QmI/wSk1LpU5xTHrsZm 9Xptp3Yp6BN9VI7XOxttYezlngk2GHMZ0uPTlzUHVnN+ZXP5DBOF4edotyo+xkdZvCeS iGXLE4kZBLKIgnrT+8gaxxPzyEzrGYPpikLB+MnPXxV6GPlqjPjBz3BxYMipeWuARPkz XRlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id c6-20020a633506000000b00578afd566cesi16184684pga.594.2023.10.02.04.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 04:16:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 373D180284F7; Mon, 2 Oct 2023 04:12:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236645AbjJBLMP (ORCPT + 17 others); Mon, 2 Oct 2023 07:12:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236609AbjJBLMN (ORCPT ); Mon, 2 Oct 2023 07:12:13 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C03A5D7 for ; Mon, 2 Oct 2023 04:12:09 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8DxBfGIpRplJJIuAA--.23828S3; Mon, 02 Oct 2023 19:12:08 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxE+SHpRplEh4XAA--.50320S3; Mon, 02 Oct 2023 19:12:07 +0800 (CST) From: Sui Jingfeng To: Lucas Stach Cc: Christian Gmeiner , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] drm/etnaviv: Drop the second argument of the etnaviv_gem_new_impl() Date: Mon, 2 Oct 2023 19:12:03 +0800 Message-Id: <20231002111207.513297-2-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231002111207.513297-1-suijingfeng@loongson.cn> References: <20231002111207.513297-1-suijingfeng@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxE+SHpRplEh4XAA--.50320S3 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW7Cw4xZw1xuF17Cw1fGF1ktFc_yoW8Xw4fpF s3AFyjkrW8Z34UK34xXFn5Ca4agr12gFyIka4kJwn8Kw45tFyDtFyrKFZ8GFsxJrWfCr13 ta1ktry5t3WUArXCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk0b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUXVWUAwAv7VC2z280aVAF wI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x 0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxU7_MaUUUUU X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 04:12:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778642209195615150 X-GMAIL-MSGID: 1778642209195615150 The mentioned second parameter is the 'u32 size', but it is not get used by the etnaviv_gem_new_impl() function, so drop it. No functional change. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index b5f73502e3dd..be2f459c66b5 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -542,7 +542,7 @@ static const struct drm_gem_object_funcs etnaviv_gem_object_funcs = { .vm_ops = &vm_ops, }; -static int etnaviv_gem_new_impl(struct drm_device *dev, u32 size, u32 flags, +static int etnaviv_gem_new_impl(struct drm_device *dev, u32 flags, const struct etnaviv_gem_ops *ops, struct drm_gem_object **obj) { struct etnaviv_gem_object *etnaviv_obj; @@ -591,8 +591,7 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file, size = PAGE_ALIGN(size); - ret = etnaviv_gem_new_impl(dev, size, flags, - &etnaviv_gem_shmem_ops, &obj); + ret = etnaviv_gem_new_impl(dev, flags, &etnaviv_gem_shmem_ops, &obj); if (ret) goto fail; @@ -627,7 +626,7 @@ int etnaviv_gem_new_private(struct drm_device *dev, size_t size, u32 flags, struct drm_gem_object *obj; int ret; - ret = etnaviv_gem_new_impl(dev, size, flags, ops, &obj); + ret = etnaviv_gem_new_impl(dev, flags, ops, &obj); if (ret) return ret; From patchwork Mon Oct 2 11:12:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 147243 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1353561vqb; Mon, 2 Oct 2023 04:23:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyNXnIvnQjBF7J9SyfzWgjpCXfQ4xDrRu0TgluZx3cM/xmJhSbHdrxRapYqwkwUxklbVsw X-Received: by 2002:a17:902:e544:b0:1c7:61a1:9688 with SMTP id n4-20020a170902e54400b001c761a19688mr3184423plf.7.1696245797294; Mon, 02 Oct 2023 04:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696245797; cv=none; d=google.com; s=arc-20160816; b=zXB2C5Kv6GEjpeXX2UmOtVC1USxAJ+oZ6/tX4sRJ4ddKdvL5B8vrGv4utYPTm7ZhI9 VrIyWXhO7JnrJWdr8KzFKimXQbpCncecQqZLCfLsCI+2B+T3bWSlYl0j7GYLSgIDcaWj f+8UOrJqGUbZtilV9alemIeLA+kRUdk9kIn6gltt4NRnoHraDNL58Q87O86F9A8BDUX7 zaRn5l3ogockEz292Y8cqCW1qfoG8laMpWbBulKIwSYRKjnu4QyRxt5lw9aqIr2Tf1OE U61vvCchdKbW/clEnmc7VCkycaOcMNgdGg9V/JyJILPAg4hSe8jc39GxtCxOrwpVzSIa bVDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Oqs4QIOnFSL8fNPo5O4U2te+6bNAbkz/0wxbUAt5Gww=; fh=zB/Le29j84eF2EWMM5mMCmgRJzHNI4kLocpkF47EhQo=; b=mLIAgMYHr582KPHBI6wzLPws3o4hKh/P5OumN7RIc3X64w38bN7WFLazBrd4o5cuaW KkW4iz4UltkAGTQynn4owpLAnsp2TgrEou69Wxrc5FEXDnPqyY9vQT8xiKCWrupOV4No dsU8pXnofkSBjk11FrJACU6/hVbyY/6noXk/PzCTUsJ/rJ0A71rH74ggbNJsAm77foti J0cnK1USLyEUAJFUqVLiA+Yezdul8B0kTzMzmJO8l4Xljc78Zf3QOIqkvrYLWLBqfhpi y5FJ1Hb3mFQyLuTWunRGh8bBLDoRhYib1Fn40UortrarTcQ5iPRYDckwvXKr5w9toosr DQXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i10-20020a170902c94a00b001bf20c806b0si23722420pla.175.2023.10.02.04.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 04:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5D017805ECF6; Mon, 2 Oct 2023 04:12:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236637AbjJBLMR (ORCPT + 17 others); Mon, 2 Oct 2023 07:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236616AbjJBLMN (ORCPT ); Mon, 2 Oct 2023 07:12:13 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1AC5CE3 for ; Mon, 2 Oct 2023 04:12:09 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8BxNuiIpRplJ5IuAA--.35397S3; Mon, 02 Oct 2023 19:12:08 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxE+SHpRplEh4XAA--.50320S4; Mon, 02 Oct 2023 19:12:08 +0800 (CST) From: Sui Jingfeng To: Lucas Stach Cc: Christian Gmeiner , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] drm/etnaviv: Fix coding style Date: Mon, 2 Oct 2023 19:12:04 +0800 Message-Id: <20231002111207.513297-3-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231002111207.513297-1-suijingfeng@loongson.cn> References: <20231002111207.513297-1-suijingfeng@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxE+SHpRplEh4XAA--.50320S4 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW7ZF1UGryrGr1DCF15Xr43urX_yoW8XF13p3 W7WFy2vrWUZ34xKw4DJF98GryfWa1xW3yIkryDA3sY9w45XFyjyr1agFZ8Gr98JryfWa47 Kr4DKFyUXFWIyrXCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk0b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r126r13M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUAVWUtwAv7VC2z280aVAF wI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x 0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxU7TKZDUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 04:12:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778642632943989669 X-GMAIL-MSGID: 1778642632943989669 1) Keep the curly brace aligned. 2) No indentation by double tabs where single tab indentation is enough. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index a8d3fa81e4ec..a3a17316a328 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -79,7 +79,7 @@ static int etnaviv_open(struct drm_device *dev, struct drm_file *file) drm_sched_entity_init(&ctx->sched_entity[i], DRM_SCHED_PRIORITY_NORMAL, &sched, 1, NULL); - } + } } file->driver_priv = ctx; @@ -233,11 +233,11 @@ static int show_each_gpu(struct seq_file *m, void *arg) } static struct drm_info_list etnaviv_debugfs_list[] = { - {"gpu", show_each_gpu, 0, etnaviv_gpu_debugfs}, - {"gem", show_unlocked, 0, etnaviv_gem_show}, - { "mm", show_unlocked, 0, etnaviv_mm_show }, - {"mmu", show_each_gpu, 0, etnaviv_mmu_show}, - {"ring", show_each_gpu, 0, etnaviv_ring_show}, + {"gpu", show_each_gpu, 0, etnaviv_gpu_debugfs}, + {"gem", show_unlocked, 0, etnaviv_gem_show}, + { "mm", show_unlocked, 0, etnaviv_mm_show }, + {"mmu", show_each_gpu, 0, etnaviv_mmu_show}, + {"ring", show_each_gpu, 0, etnaviv_ring_show}, }; static void etnaviv_debugfs_init(struct drm_minor *minor) From patchwork Mon Oct 2 11:12:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 147241 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1352281vqb; Mon, 2 Oct 2023 04:20:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQtrACDL0Cu29OsFl0c/4Eybifkn3XM2WGqGajQqH1l6luwWzm5nZ2yThInheCg9jqm7lp X-Received: by 2002:a17:902:ecca:b0:1c6:1861:70a with SMTP id a10-20020a170902ecca00b001c61861070amr13699202plh.23.1696245635183; Mon, 02 Oct 2023 04:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696245635; cv=none; d=google.com; s=arc-20160816; b=fjwW18nhzqWCjgMzZ/WCS6T2BuPDY9Oxzvg6aAWunij46WJ5X2o16FowxCG9tYowZ8 PEiTnf43g/rrgBYI8dB/6HtaZlIpJEm2py6GMFX8LmygjYpHDAYlC3X7cFW6Rq2/VCdI 3b0uzGH4X+On4qtO5shsZ9IhMaB+/wEaDFo43MvSfAwkUdIk3BakN/eEpdewmuSTP/xs 0U2xDEbUHWQdP5+spH7tydqYf0fONcbW25bdIn/JY09PpPRSsSdqTdkZucHEfXthg4Hu ViD0JIFoiKRZehaACFTb/ohx33vzsuvZMabrunBQSHRrnmlGfVwBELXOZQMxcEMj59rE dWNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FIVsoqfE1yRlM34jdkAbJd8WQCQxGGM9ifRlFQiCtvY=; fh=zB/Le29j84eF2EWMM5mMCmgRJzHNI4kLocpkF47EhQo=; b=LGQKHQ7GbwhJeuS/M3FRisvULc+19Icrwrj7ictdOy6T6XKrk1Mcxb7ZIQn1iZy/Hs 5QpOWJ0i1VKW6K/hCRkVbm0c5MIP2Ar+Dok2VFPpcAikPdthQ4OTQrLEgsfMiO36hWQV 8Af8zzpKNo9xF2qztJV8QkMnYvef0gvFdZkKxKYrw7UGNv6vHtObMf1d3Qh8u26Oae7F IBL37TNeacs7BT6KimPSzaAJgXlSjyC5ik4H2v4Szg+NrbnqHLcrsAIz3q4Tc3o+0LYn /LxEgwMfu3Y+6fcAxC0yzrUNd1NQnjGjLKw1h67QTEge9wQmSb1NWdcxuQEgtKO8i1/P xFwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id x3-20020a17090300c300b001bbcddc33dasi6813336plc.180.2023.10.02.04.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 04:20:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1461C80A1E2C; Mon, 2 Oct 2023 04:13:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236708AbjJBLNF (ORCPT + 17 others); Mon, 2 Oct 2023 07:13:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236677AbjJBLNB (ORCPT ); Mon, 2 Oct 2023 07:13:01 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D6094CEE for ; Mon, 2 Oct 2023 04:12:51 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8AxqOiwpRplQJIuAA--.52934S3; Mon, 02 Oct 2023 19:12:48 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxE+SHpRplEh4XAA--.50320S5; Mon, 02 Oct 2023 19:12:08 +0800 (CST) From: Sui Jingfeng To: Lucas Stach Cc: Christian Gmeiner , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] drm/etnaviv: Add helper functions to create and destroy platform device Date: Mon, 2 Oct 2023 19:12:05 +0800 Message-Id: <20231002111207.513297-4-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231002111207.513297-1-suijingfeng@loongson.cn> References: <20231002111207.513297-1-suijingfeng@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxE+SHpRplEh4XAA--.50320S5 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoWxCrWftF45ZryUJr15Ww4fXrc_yoW5GFyUpF 4UGFWFyrW8WFW7Kw1xJrn8ZFW5C3WSg34F9rnFywnI9398AryDJF95JF1UAF9xJrWrG3W5 twn8tF48uF45ZrXCm3ZEXasCq-sJn29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUU90b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAaw2AFwI0_Jrv_JF1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0c Ia020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_ WrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwI xGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km07C267AKxVWU XVWUAwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67 kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW5JVW7JwCI42IY 6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0x vEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVj vjDU0xZFpf9x07j5GYJUUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 04:13:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778642463408759518 X-GMAIL-MSGID: 1778642463408759518 The newly introduced functions are etnaviv_create_platform_device() and etnaviv_destroy_platform_device(). Those two function are pure function and can be shared for other use case. Currently, the benefit is that we no longer need to call of_node_put() for three different cases, we only need to call it once in the etnaviv_init() function. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 53 +++++++++++++++++++-------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index a3a17316a328..8fe39e31d22d 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -655,11 +655,43 @@ static struct platform_driver etnaviv_platform_driver = { }, }; +static int etnaviv_create_platform_device(const char *name, + struct platform_device **ppdev) +{ + struct platform_device *pdev; + int ret; + + pdev = platform_device_alloc(name, PLATFORM_DEVID_NONE); + if (!pdev) + return -ENOMEM; + + ret = platform_device_add(pdev); + if (ret) { + platform_device_put(pdev); + return ret; + } + + *ppdev = pdev; + + return 0; +} + +static void etnaviv_destroy_platform_device(struct platform_device **ppdev) +{ + struct platform_device *pdev = *ppdev; + + if (!pdev) + return; + + platform_device_unregister(pdev); + + *ppdev = NULL; +} + static struct platform_device *etnaviv_drm; static int __init etnaviv_init(void) { - struct platform_device *pdev; int ret; struct device_node *np; @@ -680,23 +712,12 @@ static int __init etnaviv_init(void) for_each_compatible_node(np, NULL, "vivante,gc") { if (!of_device_is_available(np)) continue; + of_node_put(np); - pdev = platform_device_alloc("etnaviv", PLATFORM_DEVID_NONE); - if (!pdev) { - ret = -ENOMEM; - of_node_put(np); - goto unregister_platform_driver; - } - - ret = platform_device_add(pdev); - if (ret) { - platform_device_put(pdev); - of_node_put(np); + ret = etnaviv_create_platform_device("etnaviv", &etnaviv_drm); + if (ret) goto unregister_platform_driver; - } - etnaviv_drm = pdev; - of_node_put(np); break; } @@ -712,7 +733,7 @@ module_init(etnaviv_init); static void __exit etnaviv_exit(void) { - platform_device_unregister(etnaviv_drm); + etnaviv_destroy_platform_device(&etnaviv_drm); platform_driver_unregister(&etnaviv_platform_driver); platform_driver_unregister(&etnaviv_gpu_driver); } From patchwork Mon Oct 2 11:12:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 147240 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1352256vqb; Mon, 2 Oct 2023 04:20:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4VM42Aib17oZXejijKYzqLkHZmdgKXsivzfLoj7B39z8WTxqcBx5D7AXdZeyB4NXnMthV X-Received: by 2002:a05:6a00:1825:b0:68e:2c3a:8775 with SMTP id y37-20020a056a00182500b0068e2c3a8775mr11781562pfa.33.1696245632021; Mon, 02 Oct 2023 04:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696245632; cv=none; d=google.com; s=arc-20160816; b=WL0S9SmI78vrzXfePsJ177lvEB5bTVl277xojzAmDblIk/Ryzq+shWuXOdEZl9dQjk EEk5nB4RPSCedxFoY3euvnKI2w9a+ZTl4hxkTu22n3BT8DHxV5G8eGlsOvbWx09bvwXA 227Vk1L7bLynb5Dbm9hrhIhyT7qYQt3+7gBpBIh3pdZcZoB+mfy3vYN8No8YN2KdqU6Q KToMGeSe7oNvDQerVTpCGwph0qTFfL9AI+jrOEKiwd90AdUU/zqsPnBoqOXtm2FA1mmF S6DQJchFZ1iZfKOYXRZpMhG8Unt1E867k4U0pR3J64lQ9URkc7+BxB1URC3U9q+O9pc1 ntvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TbU2rzWQsKUaIW8aws46fyBWYdZA9hZzDer1cc5MXzg=; fh=zB/Le29j84eF2EWMM5mMCmgRJzHNI4kLocpkF47EhQo=; b=EVNrrLzd/sINNzK93KHI1vDbA7YQ7xcSH+IcqEwH0JXSN/Hjwuj2w+DZgm4NHX2HfO uMuLR3LWz2EDfQdmpBi20nLt1CX9KcWI03uVqYws1ed1sFnwA3UHEkEMmfrTCl9vxRD9 q3rn+NU60g1eiKyuB8cncKDT2o7mOgtdqSp5w0jYJvt2EBN9jFgRfPhxmlYwoMYBqvc4 0DsyN1K012uqTe9eCMiBqhnP2RaYfrsbCbo1LQtnXGF4b3pnJRvsqKkgyxkQT+bND824 5AAsZLW80gX0BIwYsjZmsk2EPkYdYwV2ov7u8q1RZEnd8KfGgE5kSudOiiZ/sKeYTFL6 bBqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id eb17-20020a056a004c9100b00690158afc78si27232505pfb.284.2023.10.02.04.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 04:20:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2E7E780597AF; Mon, 2 Oct 2023 04:12:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236632AbjJBLMV (ORCPT + 17 others); Mon, 2 Oct 2023 07:12:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236633AbjJBLMN (ORCPT ); Mon, 2 Oct 2023 07:12:13 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3C081E8 for ; Mon, 2 Oct 2023 04:12:10 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8Dx_+uIpRplL5IuAA--.22517S3; Mon, 02 Oct 2023 19:12:08 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxE+SHpRplEh4XAA--.50320S6; Mon, 02 Oct 2023 19:12:08 +0800 (CST) From: Sui Jingfeng To: Lucas Stach Cc: Christian Gmeiner , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] drm/etnaviv: Add a helper to get the first available GPU device node Date: Mon, 2 Oct 2023 19:12:06 +0800 Message-Id: <20231002111207.513297-5-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231002111207.513297-1-suijingfeng@loongson.cn> References: <20231002111207.513297-1-suijingfeng@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxE+SHpRplEh4XAA--.50320S6 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW7Zr4DGFyrWryfJF4UZryfZrc_yoW8KF1fpF 43GFyYyrykWFyUK34xXFW5ZFyYkw1Iq3yFy34IkwnY9ws5AryrJr1FgFyUAF9xJFWrJ3W3 tr18tr17uF48ZrXCm3ZEXasCq-sJn29KB7ZKAUJUUUU5529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkYb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1a6r1DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IUbCzuJUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 04:12:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778642460212721723 X-GMAIL-MSGID: 1778642460212721723 This patch make the code in the etnaviv_pdev_probe() less twisted, and it also make it easier to drop the reference to device node after finished. Before apply this patch, there is no call to of_node_put() when done. We should call of_node_put() when done. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 28 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 8fe39e31d22d..a9a1659840ec 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -29,6 +29,17 @@ * DRM operations: */ +static struct device_node *etnaviv_of_first_available_node(void) +{ + struct device_node *np; + + for_each_compatible_node(np, NULL, "vivante,gc") { + if (of_device_is_available(np)) + return np; + } + + return NULL; +} static void load_gpu(struct drm_device *dev) { @@ -597,11 +608,10 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) if (!of_device_is_available(core_node)) continue; - if (!first_node) - first_node = core_node; - drm_of_component_match_add(&pdev->dev, &match, component_compare_of, core_node); + + of_node_put(core_node); } } else { char **names = dev->platform_data; @@ -634,8 +644,11 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) * device as the GPU we found. This assumes that all Vivante * GPUs in the system share the same DMA constraints. */ - if (first_node) + first_node = etnaviv_of_first_available_node(); + if (first_node) { of_dma_configure(&pdev->dev, first_node, true); + of_node_put(first_node); + } return component_master_add_with_match(dev, &etnaviv_master_ops, match); } @@ -709,16 +722,13 @@ static int __init etnaviv_init(void) * If the DT contains at least one available GPU device, instantiate * the DRM platform device. */ - for_each_compatible_node(np, NULL, "vivante,gc") { - if (!of_device_is_available(np)) - continue; + np = etnaviv_of_first_available_node(); + if (np) { of_node_put(np); ret = etnaviv_create_platform_device("etnaviv", &etnaviv_drm); if (ret) goto unregister_platform_driver; - - break; } return 0; From patchwork Mon Oct 2 11:12:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 147242 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1353558vqb; Mon, 2 Oct 2023 04:23:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6QDgYPWegzDBUZUAB52+O0wamcpd2CQehKj1Du52Rn2lBcyLM82IsO4k4cS93vbMHAAI8 X-Received: by 2002:a17:902:ec83:b0:1c7:27a1:a9e5 with SMTP id x3-20020a170902ec8300b001c727a1a9e5mr18296992plg.33.1696245797112; Mon, 02 Oct 2023 04:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696245797; cv=none; d=google.com; s=arc-20160816; b=AcbTjAWy/2EiMdEsxuhyP83SQCpXmtgtZVOo29/tL21HIWRjrhvrLNyqTEEbof0t2n M8EL0TljHQh2nyG+8QG/A8APgtM9UoYonbsFu5DlBex6weylBi/FWbqSK3oxMYFJdr6g ZrIXhTlHdwOO93QdTkFgW0kg2p1PI217tReJ7wCRmut5NfWEKuAfWU+Y/qS75w2S3nSq VZK4flgnq6/6lVBeeRA9gT7tFkARJ4KN/r4Q0tmxudZQoNvt7jBX2GjNRmE4JnHU3WCg +gdh7FtHB/Tp8NC/Aa8xaqeRkI9LrK/fum8pR6+aut8MvLfejajVx7PLKyOAfMrkBSw9 Fr4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tGRaVmecOH4f68dzWRXz7jrmwE1S3BnpFJFkLY8Jr1o=; fh=zB/Le29j84eF2EWMM5mMCmgRJzHNI4kLocpkF47EhQo=; b=wwMx1/nyVp0BPUoodoUenFY4U8Sra+QFdA8c6on2X3iMr9Jui0xygIJ/X8liIqh4JW ppkkzK6eCvsPffeDPCdDECfg2IwvTEfQjAk5XmFdZe191TEoHpw8Uc0F3WC8Yk9gyy/2 xjNO3GwtjdypqQzX/JBiajB/tPeL+Co6Gw3wS6rT2Bg/kz0zy8rqVEmjLAjmr+lq9I5h ZSeI/hhPlBh2zGWYAp8udykD0fb/OWlPsMeVQXeklF2c2C2ZG9hgN3xEiRn/CF8gLAIY d4Gnga5HKbWpWc3GeBojh9zj6m84k2p8BiBqUlbLRGUWNHjAeuWfR3OLVFi96OSLEaog 5BiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i1-20020a17090332c100b001c3da86939csi27636476plr.546.2023.10.02.04.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 04:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 78747804BDCC; Mon, 2 Oct 2023 04:12:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236672AbjJBLMY (ORCPT + 17 others); Mon, 2 Oct 2023 07:12:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236516AbjJBLMN (ORCPT ); Mon, 2 Oct 2023 07:12:13 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7FC3FDD for ; Mon, 2 Oct 2023 04:12:10 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8BxY_CIpRplNJIuAA--.23684S3; Mon, 02 Oct 2023 19:12:08 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxE+SHpRplEh4XAA--.50320S7; Mon, 02 Oct 2023 19:12:08 +0800 (CST) From: Sui Jingfeng To: Lucas Stach Cc: Christian Gmeiner , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] drm/etnaviv: Using 'dev' instead of 'etnaviv_obj->base.dev' Date: Mon, 2 Oct 2023 19:12:07 +0800 Message-Id: <20231002111207.513297-6-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231002111207.513297-1-suijingfeng@loongson.cn> References: <20231002111207.513297-1-suijingfeng@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxE+SHpRplEh4XAA--.50320S7 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW7uF1rZF48Jr4DtFWkZryktFc_yoW8Gry7pF s7JFyqkr1jvFyjk347Awn5CF13Gw43XFWSkF97G3s09w45JryktrZ8KFyDGrs8JryfCFW2 qr4ayF17WF1j93gCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkYb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1a6r1DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IUbCzuJUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 04:12:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778642632852835486 X-GMAIL-MSGID: 1778642632852835486 As in the etnaviv_gem_get_pages() function, the point to the drm_device has already been cached to the 'dev' local variable. We can use it directly, While at it, using 'unsigned int' type to count the number of pages. As the drm_prime_pages_to_sg() function takes an unsigned int type for its third argument. No functional change. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index be2f459c66b5..71a6d2b1c80f 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -100,11 +100,10 @@ struct page **etnaviv_gem_get_pages(struct etnaviv_gem_object *etnaviv_obj) if (!etnaviv_obj->sgt) { struct drm_device *dev = etnaviv_obj->base.dev; - int npages = etnaviv_obj->base.size >> PAGE_SHIFT; + unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT; struct sg_table *sgt; - sgt = drm_prime_pages_to_sg(etnaviv_obj->base.dev, - etnaviv_obj->pages, npages); + sgt = drm_prime_pages_to_sg(dev, etnaviv_obj->pages, npages); if (IS_ERR(sgt)) { dev_err(dev->dev, "failed to allocate sgt: %ld\n", PTR_ERR(sgt));