From patchwork Mon Jul 22 10:43:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 11052131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 14E32138D for ; Mon, 22 Jul 2019 10:43:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0528F28500 for ; Mon, 22 Jul 2019 10:43:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDA0428514; Mon, 22 Jul 2019 10:43:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8924A28500 for ; Mon, 22 Jul 2019 10:43:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 930F689C14; Mon, 22 Jul 2019 10:43:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1035689BCD for ; Mon, 22 Jul 2019 10:43:27 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:55388 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2) (envelope-from ) id 1hpVmv-0001lD-Ak; Mon, 22 Jul 2019 12:43:25 +0200 From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 5/9] drm/tinydrm/mipi-dbi: Remove CMA helper dependency Date: Mon, 22 Jul 2019 12:43:08 +0200 Message-Id: <20190722104312.16184-6-noralf@tronnes.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190722104312.16184-1-noralf@tronnes.org> References: <20190722104312.16184-1-noralf@tronnes.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org; s=ds201810; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=u3GkT1hSVcAAIegIRZpj+CUAFZC/g7X8qY/+K+kOBkk=; b=iCZdfxMKJtgJWelbZIkcP2wShOHTpSliEvJNv7u5UM4ObbHlXOR/1ngeeFI+E4cOXmBh9MZRAnenpzsX+reu4J1hKCpNwj7ISaSKYJ7c9rhK/S8D+1FS2cGpe1kay9jm3VzshCv6aaK2Fghw5gTkIuSG0OvUbCdFPI2qbFmQCpaI2NTWICmqOaoaHa8EzUQp/3QX2PcKFeHmSPbTJSnIUKRYa9AChvbMFMpwZi92RYFTVLUIlYLBB72U5cjEn0eGlMZiuX06Vin49l/rw04FJko8Jpn5Pa8nBYHAf4ktpuCx2x2/FIaihWzqFiLmLdX7tX13wAnIXQxaoro0FrtIMg==; 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: sam@ravnborg.org, david@lechnology.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP mipi-dbi depends on the CMA helper through it's use of drm_fb_cma_get_gem_obj(). This is an unnecessary dependency to drag in for drivers that only want to use the MIPI DBI interface part. Avoid this by open coding the function. Signed-off-by: Noralf Trønnes Reviewed-by: David Lechner --- drivers/gpu/drm/tinydrm/mipi-dbi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 1617784fef09..d6f3406a4075 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -201,8 +200,9 @@ EXPORT_SYMBOL(mipi_dbi_command_stackbuf); int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb, struct drm_rect *clip, bool swap) { - struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0); - struct dma_buf_attachment *import_attach = cma_obj->base.import_attach; + struct drm_gem_object *gem = drm_gem_fb_get_obj(fb, 0); + struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(gem); + struct dma_buf_attachment *import_attach = gem->import_attach; struct drm_format_name_buf format_name; void *src = cma_obj->vaddr; int ret = 0; @@ -240,7 +240,8 @@ EXPORT_SYMBOL(mipi_dbi_buf_copy); static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect) { - struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0); + struct drm_gem_object *gem = drm_gem_fb_get_obj(fb, 0); + struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(gem); struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev); unsigned int height = rect->y2 - rect->y1; unsigned int width = rect->x2 - rect->x1;