From patchwork Thu Oct 10 09:34:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 175737 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2030315ill; Thu, 10 Oct 2019 02:35:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyIYzwYSmvNP87aFuvyezXkhoyJn6yAtbv4lCXIpzOVuUjyBhOKBCFACALpLajp1aAeLa+ X-Received: by 2002:a17:90a:2ec3:: with SMTP id h3mr10349332pjs.131.1570700123648; Thu, 10 Oct 2019 02:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570700123; cv=none; d=google.com; s=arc-20160816; b=MBVe+aXkn1cQF1iru6PtA1kVEClvRVoygEYrYxWOY+9nQw5/0rG52JKY9PhJNC45tR ULL11HZuG0mErAOvxKsTZPstzl3PJ5RH+hAzO1x2BQJL6TnLym+mC0H9CGIYwfUqfLfw R3K72OPq3ujD9f7i61buNyPTAO0S/YDnDX3OrKLwfmF2/tvUyB1dE0O7ePBDLLBESzwJ HxF2P5g6P6CzCNgsSUXS/ABk4CddBbFlz4+H+L7Hno+4/yX4uSIx2M2TsoluiRXccQjZ thU/iFccG1Ox1SAtJgVVyUobtBXAOLCTkTEXfsyYwojwvNfUTWoQbI0HiW9jfy8gV0Fr LF3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=68hVYg6DBHDONmzSTFThCTwfh15xAy9D10zk3KcAlp8=; b=xF3tdMwJhNjQSgGZBo7c9C6uKzJ2JFYWDOmHPAJdfHRl41hH2OuUYke0Cq4EHpOZEk QZS9HtGLI0cEoEeTUSIk4mEnleoPYAEmRvZpXLJCQyvOj4NJZbYTlIT2mYyIOVL12T6H 0naIesxQ/eThdBLZuaE7NYkX21kLUi1z9lndFcRntA6x0qHHJ8sb5hrrrYN2M2QgBTNO PycBKZ/krdznOrj+BXz1fJNC0jEcdtYEHuLFVkvqK/ER0eoajddfe7YAOWaABHtyoUiG 6oo/dKOeKiz3TkTXRkDwVDtLpuu5iWH03VBrQrnkRt+CLa/qNG4s4hV6mRIP5db7ZgeF eZdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id 99si5460481pld.162.2019.10.10.02.35.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Oct 2019 02:35:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8B306EAE1; Thu, 10 Oct 2019 09:35:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7FEAD6EADC for ; Thu, 10 Oct 2019 09:35:12 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9A9ZAoq007940; Thu, 10 Oct 2019 04:35:10 -0500 Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9A9ZATj118475 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 10 Oct 2019 04:35:10 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 10 Oct 2019 04:35:10 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 10 Oct 2019 04:35:10 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9A9Z91I013241; Thu, 10 Oct 2019 04:35:10 -0500 From: Jean-Jacques Hiblot To: , , Subject: [PATCH v4 3/8] drm/omap: accept NULL for dma_addr in omap_gem_pin Date: Thu, 10 Oct 2019 11:34:40 +0200 Message-ID: <20191010093445.11069-4-jjhiblot@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010093445.11069-1-jjhiblot@ti.com> References: <20191010093445.11069-1-jjhiblot@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1570700110; bh=BGD4E2M5dmRS1t3Z+6V//s+uSJyTYNPcVeFAaQ+oob8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=F9EIsb8UfCCqMFDoXbDkhfpxv2DvPHV/YJK94FpfcZNiicUuQILBMkpzYz+fdpf10 ZBwuYwVzubSPfhGetDA0KW63Cf1e3OIi/pWVG9ncgBBW29v2dBC92c3vc9zGoK8rIH gl49dB5FFj7X7DE3KEnCBzkZopm5sxiepd8vy6KM= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jsarha@ti.com, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Tomi Valkeinen Allow NULL to be passed in 'dma_addr' for omap_gem_pin(), in case the caller does not need the dma_addr. Signed-off-by: Tomi Valkeinen Reviewed-by: Jean-Jacques Hiblot --- drivers/gpu/drm/omapdrm/omap_gem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 3071e815da73..2ac83cdbb15a 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -817,9 +817,11 @@ int omap_gem_pin(struct drm_gem_object *obj, dma_addr_t *dma_addr) refcount_inc(&omap_obj->dma_addr_cnt); } - *dma_addr = omap_obj->dma_addr; + if (dma_addr) + *dma_addr = omap_obj->dma_addr; } else if (omap_gem_is_contiguous(omap_obj)) { - *dma_addr = omap_obj->dma_addr; + if (dma_addr) + *dma_addr = omap_obj->dma_addr; } else { ret = -EINVAL; goto fail;