From patchwork Mon Jul 9 13:44:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 141403 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2687499ljj; Mon, 9 Jul 2018 06:44:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeYL+7ouCIS2NpVjo/aQLASBmRJaCBc3TX6EfF8hcRmOokHxQKuo1rJv2+lzxInLYfxRAtU X-Received: by 2002:a62:e813:: with SMTP id c19-v6mr21210123pfi.124.1531143889088; Mon, 09 Jul 2018 06:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531143889; cv=none; d=google.com; s=arc-20160816; b=gblCIPOlGCgSjNMaauPB97LMG0Tl7zaWTdAxGhCK4HGKg78RX+kVmZbLAucSyibiFP GMEOALGxrkKEKRg0D4bnvq7AtUyGMr2jr91qrKBv+UxtRNTINswy/TBUIS3d/JQAX/XM AHTofQ4AJLkFBFRWouRiAc8awswEhmkP9Gszfs1Ay46ulw2xmMSYBZhwvwnK1cprzerM nDQQnQIEG7QgkUUhVguT1vhNdL0Z7x7PWkEPCq+A9RKIdSBGAaF0R64mNkdJTfXcr0pG FwfGQ043nu12qtFknx3qskcZQLeqshsLWMSUnq8J6NLQLP2ea2XiTFr1Mm+QXXPzpdLh Ru+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :in-reply-to:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=7bF0JtcWe0JensH1slmKKawdleMidvP8p5KZWuG9nn8=; b=mFM9sIlSShsmaRN8xMq4quDkNgZZ5zQq9c46is3udTxnZaQwiX6wAM2a8kFpJZQRcq WZJt4gDIANupNLe7nyt4wao8bgLDQFjrKU/T4qLGq7l6rsuyr2pbsa+TCDMVjptHHZ2L beaZYpK1fNriBy1ykxip0ifin+Vy3lCj2i3br3hXDsTrwHmcxKYbl2ZaQvuBhgS96KwV kunr9S4YyI9ATGLnBdCu8CIFncwNY3uhMlBmkpC4pmW0bCERkOv0H1GX66sHOxoPcxFz 5gjtn5fm6Bokw7MpLnQN1uY5iH7gQqdBWPVN7f/NZODfCVZSKagf2/eKxKBK3UdogHC/ yBDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=QEVU1XlY; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d26-v6si14339793pgb.571.2018.07.09.06.44.48; Mon, 09 Jul 2018 06:44:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=QEVU1XlY; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754492AbeGINos (ORCPT + 3 others); Mon, 9 Jul 2018 09:44:48 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:47029 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754517AbeGINoq (ORCPT ); Mon, 9 Jul 2018 09:44:46 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180709134445euoutp013025c305bc64862c76a0c765014d5bca~-t0BFrum62754527545euoutp01l for ; Mon, 9 Jul 2018 13:44:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180709134445euoutp013025c305bc64862c76a0c765014d5bca~-t0BFrum62754527545euoutp01l DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1531143885; bh=iekuFsI6jsQIFeLzcAkSeKAJ1DBgDFnbIin8/KauFVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QEVU1XlYMn7ro7G4TVJiNWjDMEyzFIm4OcECzW7rv6blXVwUQyPFO8SLaEruT5iYW 4wvCUdN8mZS+65dL1024gqNP5PcH8BK5VKO7xE0XBv7nddKsGewh7Q8UNovR4Q3R8c m11fJbQ1t9ViZXFvabxXX1UZGfBAsgf2LnhpacU8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180709134444eucas1p22fb61ec3992fd73120323be09335199d~-t0Ak2mOm1390813908eucas1p2R; Mon, 9 Jul 2018 13:44:44 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 80.85.05700.CC6634B5; Mon, 9 Jul 2018 14:44:44 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180709134443eucas1p185858b2e90b4bbb7df71487aaa757b77~-tz-5TB3c1700017000eucas1p1k; Mon, 9 Jul 2018 13:44:43 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180709134443eusmtrp2a0dafb2e105adbe0a0c5b742cfb1df25~-tz-naepv2764427644eusmtrp2k; Mon, 9 Jul 2018 13:44:43 +0000 (GMT) X-AuditID: cbfec7f2-1c1ff70000011644-be-5b4366ccbb40 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id DB.10.04178.AC6634B5; Mon, 9 Jul 2018 14:44:42 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.116.147.25]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180709134442eusmtip1b2767d3237a2c2e9bd02bcb475aaabee~-tz_u9qnN1056310563eusmtip1W; Mon, 9 Jul 2018 13:44:42 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Andrzej Hajda , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Tobias Jakobi Subject: [PATCH v2 3/3] drm/exynos: Use common exynos_drm_gem_get()/put() functions for GEM lookup Date: Mon, 9 Jul 2018 15:44:32 +0200 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180709134432.26992-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42LZduznOd0zac7RBv1HeCxurTvHarFxxnpW iytf37NZTLo/gcXi/PkN7BYzzu9jslh75C6QNfklm0Xb6g+sDpwem1Z1snnc7z7O5PHvGLtH 35ZVjB6fN8kFsEZx2aSk5mSWpRbp2yVwZfy/MI+lYJlkxdnGFawNjP9Euhg5OSQETCTu7zvD CmILCaxglPj8RKuLkQvI/sIosejEMmYI5zOjxMbFq5hgOhp+PoNKLGeUOL/7DTuE85VRYvfh O+wgVWwChhJdb7vYQGwRATeJpsMzWUGKmAU2MklsfjQRbJSwQIrE+5aHzCA2i4CqxL/uEywQ K+QlVm84ABbnFLCTODH1PyNIs4TAbzaJKzueATVzcPAKlElcehIGUe8i0fx0PiOELSzx6vgW dghbRuL/zvlMEL3NjBLtM2axQzg9jBJb5+xgg6iyljh8/CIryFBmAU2J9bv0IcKOEu/W/gXb JSHAJ3HjrSBImBnInLRtOj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wfEwenVAOj3f1r/+dukrrJFWMS9NuA 98Dkz1PnfHnJyrb2f996y44/5WG13iUcX3jY2Rnyqv5I7gkTd5/pcTN5w7ZAZ9nV8zXitDg2 rAh1+6DDphW983bTTuEff+cmbmLR5d/i8UXulUrjFGWDJ54TlDp5f72b6awwt3WK4uwz3SsO C85Rmim39E2TWvAdJZbijERDLeai4kQAId0MBXkCAAA= Message-Id: <20180709134443eucas1p185858b2e90b4bbb7df71487aaa757b77~-tz-5TB3c1700017000eucas1p1k@eucas1p1.samsung.com> X-CMS-MailID: 20180709134443eucas1p185858b2e90b4bbb7df71487aaa757b77 X-Msg-Generator: CA X-RootMTR: 20180709134443eucas1p185858b2e90b4bbb7df71487aaa757b77 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180709134443eucas1p185858b2e90b4bbb7df71487aaa757b77 References: <20180709134432.26992-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use recently introduced common helpers to unify GEM handling code. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_fb.c | 10 ++++------ drivers/gpu/drm/exynos/exynos_drm_ipp.c | 10 +++++----- 2 files changed, 9 insertions(+), 11 deletions(-) -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 27b7d34d776c..9f52382e19ee 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -101,7 +101,6 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, { const struct drm_format_info *info = drm_get_format_info(dev, mode_cmd); struct exynos_drm_gem *exynos_gem[MAX_FB_BUFFER]; - struct drm_gem_object *obj; struct drm_framebuffer *fb; int i; int ret; @@ -112,15 +111,14 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, unsigned long size = height * mode_cmd->pitches[i] + mode_cmd->offsets[i]; - obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[i]); - if (!obj) { + exynos_gem[i] = exynos_drm_gem_get(file_priv, + mode_cmd->handles[i]); + if (!exynos_gem[i]) { DRM_ERROR("failed to lookup gem object\n"); ret = -ENOENT; goto err; } - exynos_gem[i] = to_exynos_gem(obj); - if (size > exynos_gem[i]->size) { i++; ret = -EINVAL; @@ -138,7 +136,7 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, err: while (i--) - drm_gem_object_put_unlocked(&exynos_gem[i]->base); + exynos_drm_gem_put(exynos_gem[i]); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index b435db8fc916..23226a0212e8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -350,13 +350,13 @@ static int exynos_drm_ipp_task_setup_buffer(struct exynos_drm_ipp_buffer *buf, unsigned int height = (i == 0) ? buf->buf.height : DIV_ROUND_UP(buf->buf.height, buf->format->vsub); unsigned long size = height * buf->buf.pitch[i]; - struct drm_gem_object *obj = drm_gem_object_lookup(filp, + struct exynos_drm_gem *gem = exynos_drm_gem_get(filp, buf->buf.gem_id[i]); - if (!obj) { + if (!gem) { ret = -ENOENT; goto gem_free; } - buf->exynos_gem[i] = to_exynos_gem(obj); + buf->exynos_gem[i] = gem; if (size + buf->buf.offset[i] > buf->exynos_gem[i]->size) { i++; @@ -370,7 +370,7 @@ static int exynos_drm_ipp_task_setup_buffer(struct exynos_drm_ipp_buffer *buf, return 0; gem_free: while (i--) { - drm_gem_object_put_unlocked(&buf->exynos_gem[i]->base); + exynos_drm_gem_put(buf->exynos_gem[i]); buf->exynos_gem[i] = NULL; } return ret; @@ -383,7 +383,7 @@ static void exynos_drm_ipp_task_release_buf(struct exynos_drm_ipp_buffer *buf) if (!buf->exynos_gem[0]) return; for (i = 0; i < buf->format->num_planes; i++) - drm_gem_object_put_unlocked(&buf->exynos_gem[i]->base); + exynos_drm_gem_put(buf->exynos_gem[i]); } static void exynos_drm_ipp_task_free(struct exynos_drm_ipp *ipp,