From patchwork Thu Jun 7 13:36:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137892 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2108601lji; Thu, 7 Jun 2018 06:36:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKwX+1tpThXzIfdt2nS37gyPfEOAKw8SLVLnaxMVCJxPDsnL7sM923I90kCdcumTvQrHbfb X-Received: by 2002:a62:5d83:: with SMTP id n3-v6mr1881885pfj.68.1528378585287; Thu, 07 Jun 2018 06:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528378585; cv=none; d=google.com; s=arc-20160816; b=MzUqMoTVqmqfKSzi0zi3JXAvaZmOGCOUGXdh0mvzCIcqYKnbZcH7dNLXGOPT6LwN8r oua2EHIM/Fd7RtAsvv50RHPwNlUzHz3TsXIFKBkGDQ6Tcfndi4Em56b1X2EgtiwuLVBe +hFn8KraijHmze3DCrXvw4+Gsj6p+RWXmwOlYoXFAJf9oHWvjSYg8XEjnnUQ0sVJ8WV6 26sV2vdf3SufN/Eo+jvfCIyjZVlH0uI1frTS+NLyW2BLCjNCOXm9/PJkzGZWliHi1hyc UWZDIhwEfxqx3jW1fVKznWQHAOnyimh86fkxKKtye9rIsHcJH9DxIyH5EGsNmXtF1ol/ 15lA== 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:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=we4J2N4IUxQDjhIa/xO7/tASpHmFRO5Y78FBHHidCsY=; b=SfP8zoz3LhRn3tDSfSwCX4V1+oYhiyC6YwamWmX0Ye9FMiLjuCwRpsEwGov/dKmy6Q cR2CpNg5juzmvURdxmijVm4XenZoTyWMrTJguIZBIXiWtJdWmje600c34mXApcpIgsIE PmgzYR5Ad4GSkywR7aLGxpS6U9+y+qQ4q/ZRCTk0ySe0FvIrjHWSLfuG6xPLV3r4/e2C GQz0dkttm3BODivMuxRJcw+YkBknHeKFAkoCMjizqPe0pazkTi7WLnk33RPuo26nj4/J C24gp8aIO0vD8IZ4kFcyjoXoOFE8GNAwsdch+XlKEVZ8xeC0slpC2wfj4Ej/yTomWPEg 1xJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=SGHyMBOO; 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 h127-v6si57919045pfb.111.2018.06.07.06.36.25; Thu, 07 Jun 2018 06:36:25 -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=SGHyMBOO; 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 S932578AbeFGNgY (ORCPT + 3 others); Thu, 7 Jun 2018 09:36:24 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:54095 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932457AbeFGNgW (ORCPT ); Thu, 7 Jun 2018 09:36:22 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180607133620euoutp0213fe6976a413478c3cd8a8308a934c3e~15DiaqBfI0829208292euoutp02u; Thu, 7 Jun 2018 13:36:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180607133620euoutp0213fe6976a413478c3cd8a8308a934c3e~15DiaqBfI0829208292euoutp02u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528378580; bh=ArTnaRsSEZR5ccB3bQ5NxriIOJuM5u/+VaSQ7aXaWxU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=SGHyMBOOhZIfTD7ggM93szFN/bMumpPtXB0NvOWdp95XgVI3L+PdVPumyJLQHl9L/ jWK88wOYgDGqVBbgIGxw5yM310u/RFyuEc7uZug6wz53BB+GGVpUjDSlIZjFmpPgcV pGJI8LuJxjdaqRLfgASC5958gCbGA/0GpcmriIZQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607133619eucas1p10f7e48c5823482c92ef40b5d112acc0d~15Dha9ASC2458724587eucas1p1Y; Thu, 7 Jun 2018 13:36:19 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A8.A9.10409.2D4391B5; Thu, 7 Jun 2018 14:36:18 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180607133617eucas1p2409012bcecf42728a0d6d54e3e80c710~15Df8Pmju2920129201eucas1p2V; Thu, 7 Jun 2018 13:36:17 +0000 (GMT) X-AuditID: cbfec7f5-f95739c0000028a9-75-5b1934d28b94 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id AB.A0.04183.1D4391B5; Thu, 7 Jun 2018 14:36:17 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P9Y00B59GGBIO30@eusync4.samsung.com>; Thu, 07 Jun 2018 14:36:17 +0100 (BST) 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 3/4] drm/exynos: Use common exynos_drm_gem_get()/put() functions for GEM lookup Date: Thu, 07 Jun 2018 15:36:08 +0200 Message-id: <20180607133609.28397-4-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180607133609.28397-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRmVeSWpSXmKPExsWy7djP87qXTCSjDToei1vcWneO1WLjjPWs Fle+vmezmHR/AovF+fMb2C1mnN/HZLH2yF0ga/JLNou21R9YHTg9Nq3qZPO4332cyePfMXaP vi2rGD0+b5ILYI3isklJzcksSy3St0vgyriy5wt7wTrJisat85gbGNtEuxg5OSQETCTePtzP 3sXIxSEksIJR4uvJdWwQzmdGiQPL1rHAVC3d/50RIrGMUWLVshaolgYmidl7drOBVLEJGEp0 ve0Cs0UE3CSaDs9kBSliFtjIJLH50UQmkISwQKLE4WvHwMayCKhK/Dz4jx3E5hWwlZj5bxoT xDp5idUbDjCD2JwCdhKT3+9kBhkkITCFTWLyjmeMEEUuEj1XzjFD2MISr45vYYewZSQuT+5m gWhoZpRonzGLHcLpYZTYOmcHG0SVtcTh4xdZQWxmAT6JSdumA03iAIrzSnS0CUGUeEi0b97O DPHnREaJnUt+s01glFzAyLCKUTy1tDg3PbXYOC+1XK84Mbe4NC9dLzk/dxMjMDJP/zv+dQfj vj9JhxgFOBiVeHgb7otHC7EmlhVX5h5ilOBgVhLhTbwkFi3Em5JYWZValB9fVJqTWnyIUZqD RUmcN06jLkpIID2xJDU7NbUgtQgmy8TBKdXAGM31JkIoXnT1plfcP36E2r6MWas98+YVl+Ov 95n/qera9kFFOV3RzyjKdWI+S46eZIGTbN/1qpYJK/6xZ4g1vXvwPaFtbtqP5ukfig3efJm+ fXbXgqQFJ3wehhYxsLuFzmQrvql7qpNr4ftcli/Jy/avDJ6zXsdghti1nG0nzxYFu+hfv8T/ SImlOCPRUIu5qDgRABP7YZ/IAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprILMWRmVeSWpSXmKPExsVy+t/xa7oXTSSjDa4tZba4te4cq8XGGetZ La58fc9mMen+BBaL8+c3sFvMOL+PyWLtkbtA1uSXbBZtqz+wOnB6bFrVyeZxv/s4k8e/Y+we fVtWMXp83iQXwBrFZZOSmpNZllqkb5fAlXFlzxf2gnWSFY1b5zE3MLaJdjFyckgImEgs3f+d sYuRi0NIYAmjxJsHa6CcJiaJ3dv2M4JUsQkYSnS97WIDsUUE3CSaDs9kBSliFtjMJNFzvB+s SFggUeLwtWMsIDaLgKrEz4P/2EFsXgFbiZn/pjFBrJOXWL3hADOIzSlgJzH5/U4wWwioZt2b xWwTGHkWMDKsYhRJLS3OTc8tNtIrTswtLs1L10vOz93ECAyobcd+btnB2PUu+BCjAAejEg/v jYfi0UKsiWXFlbmHGCU4mJVEeBMviUUL8aYkVlalFuXHF5XmpBYfYpTmYFES5z1vUBklJJCe WJKanZpakFoEk2Xi4JRqYKx73PNzhfid6VtY7131lUxLKHhz46jx+b88inmrawt+NO8JLXwe LLb0yLVbf0tPd1yfHSu7zmDiiYfGfh8mLhZ8+4A1J6jyRBbDhuvTUi37mOancpfbf5rvvvSp lDA3g8skk1/ucrMurNnZYlGy+sOKNYlFUtrNK6eaSxuo+h3jZzCQW84REqnEUpyRaKjFXFSc CAB1Zqs1JAIAAA== X-CMS-MailID: 20180607133617eucas1p2409012bcecf42728a0d6d54e3e80c710 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607133617eucas1p2409012bcecf42728a0d6d54e3e80c710 References: <20180607133609.28397-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 7fcc1a7ab1a0..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_unreference_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 26374e58c557..2963acfbe350 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -371,13 +371,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++; @@ -391,7 +391,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; @@ -404,7 +404,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,