From patchwork Fri Oct 31 22:54:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5207321 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 22E81C11AE for ; Fri, 31 Oct 2014 23:56:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F03E2014A for ; Fri, 31 Oct 2014 23:56:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 62AA820158 for ; Fri, 31 Oct 2014 23:56:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D92A66E84F; Fri, 31 Oct 2014 16:56:38 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 860FF6E857 for ; Fri, 31 Oct 2014 15:57:39 -0700 (PDT) Received: by mail-pa0-f47.google.com with SMTP id kx10so8601188pab.34 for ; Fri, 31 Oct 2014 15:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MrFTfu5aNxBfWZV+hBcfCxIsRnhTDPfWI/bBBVokrGg=; b=GWBO4gAGA3aWwsnF5DaFSM6gaKAeFvH1fkd/9t5VOjcF3yg8+V8EZWPwMB9U0/AoY8 EW4egIF7PU3cHbEn891roIvPIIGV9wRAjfKjwYVtF9uCIy691kTbrpTm61I2NkvaV5fh ssHsRMmVk/9dHf6bXnPyllygDUlTRU3ixi1mhCualasEuQmfDeBvGc4GiP/Ci2TRruvE VUJMf6JHzlr9WJp36Gqi2ZHc0DsqmmndA9Sdg3e3ZuLqbgu8qLBfFz7YDanO2mV5csTo R+kGcygXS/IJ5IR1HxJ9+GQPATnmZEkmrhGUXz+BGfuuzXQpPeKRI4hbyBha6YYY33w6 wC+g== X-Received: by 10.66.191.135 with SMTP id gy7mr27604720pac.95.1414796259422; Fri, 31 Oct 2014 15:57:39 -0700 (PDT) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id ev8sm10870656pdb.28.2014.10.31.15.57.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 15:57:39 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: dri-devel@lists.freedesktop.org Subject: [PATCH 62/72] imx-drm: ipuv3-plane: Assign correct dmfc burst size Date: Fri, 31 Oct 2014 15:54:45 -0700 Message-Id: <1414796095-10107-63-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> References: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Fri, 31 Oct 2014 16:56:32 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to the imx6 reference manual, the DMFC channel's burstsize must match the corresponding IDMAC channel's burstsize, so make sure to pass the IDMAC channel burstsize to ipu_dmfc_alloc_bandwidth(). We need to move ipu_dmfc_alloc_bandwidth() to after the channel is setup, in order to first initialize the channel burstsize, before retrieving it with ipu_cpmem_get_burstsize(). Signed-off-by: Steve Longerbeam --- drivers/staging/imx-drm/ipuv3-plane.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/staging/imx-drm/ipuv3-plane.c b/drivers/staging/imx-drm/ipuv3-plane.c index 61d47e9..aa10ae7 100644 --- a/drivers/staging/imx-drm/ipuv3-plane.c +++ b/drivers/staging/imx-drm/ipuv3-plane.c @@ -159,7 +159,7 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc, { struct device *dev = ipu_plane->base.dev->dev; bool is_bg = (ipu_plane->dp_flow == IPU_DP_FLOW_SYNC_BG); - int ret; + int burstsize, ret; /* no scaling */ if (src_w != crtc_w || src_h != crtc_h) @@ -238,14 +238,6 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc, } } - ret = ipu_dmfc_alloc_bandwidth(ipu_plane->dmfc, - calc_bandwidth(crtc_w, crtc_h, - calc_vref(mode)), crtc_w, 64); - if (ret) { - dev_err(dev, "allocating dmfc bandwidth failed with %d\n", ret); - return ret; - } - ipu_cpmem_zero(ipu_plane->ipu_ch); ipu_cpmem_set_resolution(ipu_plane->ipu_ch, src_w, src_h); ret = ipu_cpmem_set_fmt(ipu_plane->ipu_ch, fb->pixel_format); @@ -260,6 +252,16 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc, ipu_cpmem_set_high_priority(ipu_plane->ipu_ch); + burstsize = ipu_cpmem_get_burstsize(ipu_plane->ipu_ch); + + ret = ipu_dmfc_alloc_bandwidth(ipu_plane->dmfc, + calc_bandwidth(crtc_w, crtc_h, + calc_vref(mode)), crtc_w, burstsize); + if (ret) { + dev_err(dev, "allocating dmfc bandwidth failed with %d\n", ret); + return ret; + } + /* enable double-buffering */ ipu_idmac_set_double_buffer(ipu_plane->ipu_ch, true);