From patchwork Fri Jun 16 11:31:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 105714 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1254960qgd; Fri, 16 Jun 2017 04:32:20 -0700 (PDT) X-Received: by 10.99.121.71 with SMTP id u68mr10902649pgc.167.1497612739987; Fri, 16 Jun 2017 04:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497612739; cv=none; d=google.com; s=arc-20160816; b=kMyze5iWuOQDOFrqp4JIaV21Qi5+ZiRpkPQTHwFvs1BsuMqEXQPJBG4xqPjJId60zJ pbItVc6FUk0VAXMUYSXk/SszZ0bMd96oOkl+/90rM4mlGZQr3jHGeowL1v4yuArriZuI m/LcUUJW+XayfAMvTqNW0fNhUIUGP4kL+JH8odtx9fRL01fZ4NZ0wyNSbeveit7GJkxU 4kVcaeMLGhnwZwEfUAPQmJc2LE3rV+d+sNDUv04JkO2jFQHjttzIEH24VN372iTrTlNF osbUn/HS53x+Z9/l//fn4JhtDTLaTbEB4YA+6j9xdFLCQnWR1HnuuMKQGsTGncxlJ1gL F68w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=SmIDlenSdFQVHDAB0eIcd/8Siai4eIhwhykEYL6zaV4=; b=p4LYkuaEU5k7dFqR1S2KrfQxUOGDRcG2suACueLYE0tlpa43llmx8eKXq8NxNb2Cr7 O8JT9pjij+tA9dnfsueahOTDsE+g/0mmkQApq4iWc485peB8sJQgTfsHfP40fW6mqWEA IaQK2F5G/ZilEU/lOO9j6bqu+fjl2njo1LnXLR4E9Zi+q+3KpPO/U182ctN4Pi4kzCat tlNZNrtV3bqVqUTOGiu79DZ3wCoQT4RtpVrHiJk7w3MnPl4Qi4iyKV8l/RzzUcLQ3Pz6 3CPchD9xYpSKVVc6FeEdJzVGT6lGHw8nPNmsrVuKxjzElN6loXihK3rc2FwE8miHQx0P G4UA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r21si1791707pgr.106.2017.06.16.04.32.19; Fri, 16 Jun 2017 04:32:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753233AbdFPLcC (ORCPT + 25 others); Fri, 16 Jun 2017 07:32:02 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:53001 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752676AbdFPLcB (ORCPT ); Fri, 16 Jun 2017 07:32:01 -0400 Received: from e110455-lin.cambridge.arm.com (e110455-lin.cambridge.arm.com [10.2.131.9]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id v5GBVoFJ027101; Fri, 16 Jun 2017 12:31:50 +0100 From: Liviu Dudau To: Liviu Dudau Cc: Brian Starkey , David Airlie , DRI devel , LKML , Russell King - ARM Linux , Liviu Dudau Subject: [PATCH] drm/arm: hdlcd: Use CMA helper for plane buffer address calculation Date: Fri, 16 Jun 2017 12:31:50 +0100 Message-Id: <20170616113150.25440-1-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.13.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CMA has gained a recent helper function for calculating the start of the plane buffer's physical address. Use that instead of the hand rolled version. Signed-off-by: Liviu Dudau --- drivers/gpu/drm/arm/hdlcd_crtc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) -- 2.13.1 diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 1a3359c0f6cd..0128ebd318f5 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -261,21 +261,14 @@ static void hdlcd_plane_atomic_update(struct drm_plane *plane, { struct drm_framebuffer *fb = plane->state->fb; struct hdlcd_drm_private *hdlcd; - struct drm_gem_cma_object *gem; u32 src_x, src_y, dest_h; dma_addr_t scanout_start; if (!fb) return; - src_x = plane->state->src.x1 >> 16; - src_y = plane->state->src.y1 >> 16; dest_h = drm_rect_height(&plane->state->dst); - gem = drm_fb_cma_get_gem_obj(fb, 0); - - scanout_start = gem->paddr + fb->offsets[0] + - src_y * fb->pitches[0] + - src_x * fb->format->cpp[0]; + scanout_start = drm_fb_cma_get_gem_addr(fb, plane->state, 0); hdlcd = plane->dev->dev_private; hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);