From patchwork Tue Jan 30 15:24:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 126262 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3457556ljd; Tue, 30 Jan 2018 07:24:10 -0800 (PST) X-Google-Smtp-Source: AH8x224KbxS60kAgtKsxr6IY0lWjfb2KNWh1aNze7W1xxgsj7jAMgdwBi+VAW+puKTwNbx1+6rYY X-Received: by 10.101.102.3 with SMTP id w3mr24222187pgv.326.1517325850458; Tue, 30 Jan 2018 07:24:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517325850; cv=none; d=google.com; s=arc-20160816; b=csHxa0Khk4NYhb9VCkLN7RURREhzN4XbzsEIT1ydqWGsqY3Kig/j//FPuDOpAZm71K 2xV5+U4+8drd3naFM87sKnszK8+6lhMNpV1aLO7GrnGQ0rXGLMBAaN0DoqcUDMoZdclg qFjr3HOrIAt0TtwAKS++zO00RK3RE52PtCltRApnoRc5W+y/u2GSwFpjDXFQHpMXfKpg osOO4pLXVivCMBsYayRqqny6yVL5n695LTAdUAytjA61D5oR3g2TEzqoIvcFBhFRu7Gr GvQMwBImtPhLwfzIufd1aui7Midas15ftSGo9DiLMgeMmtXA2aJOvid30Z1LLkHr7J4k 4/cg== 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 :dkim-signature:arc-authentication-results; bh=fSIz0bp6LgftNoGf4cDnyVrN1Nr/6IhpDhaD0QK7GmI=; b=CqVrMUJfKvka5Pc8MBYSwkMRBI6vr9478dXXJP2cpfrYHFeK0eDMj6bx3rkHsnbJdx 0j4ZrZyTxOcJHqTJkhQ7oIYmKWwlC+KTkudz7s1zelSb44CmerXkmUwlOSQvSUA1gSt7 Kudr79zfgRu6Z905cyaXynC5jwTvRf8nkpNUPgjeaSDXZ3Bx8LwGW2WJBMnRe+foI00g tBA9OXX5xvo80PF3HY9ow95EuAozEjpPBXBmQskpKaW7SIJxN8GyXPlQ1F4SEgsWnA7c Q0txayF4DNAEfe4aysCoZMn9/XSzu3oIfd2+kmKeNXbi2y1kvZGM0wmhuwrK1FybSBVQ Le3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DTHYyUjX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si14543234pfh.381.2018.01.30.07.24.10; Tue, 30 Jan 2018 07:24:10 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=DTHYyUjX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753147AbeA3PYI (ORCPT + 25 others); Tue, 30 Jan 2018 10:24:08 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:37965 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752525AbeA3PYH (ORCPT ); Tue, 30 Jan 2018 10:24:07 -0500 Received: by mail-wr0-f195.google.com with SMTP id t94so46532wrc.5 for ; Tue, 30 Jan 2018 07:24:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=fSIz0bp6LgftNoGf4cDnyVrN1Nr/6IhpDhaD0QK7GmI=; b=DTHYyUjXuzA5knfw99oe6Pmt9czTTakyh1/S5iinQj+jDaYQtEhSOZfmMYOph6rEDT GHykwrzrz6lm3a+HIrS3HY1LP8scuQxuJ87BWbdC6pAo+cfPHxhGdFXyixx9k9f81dA/ M4z+wd9z1ztB7ksal2PG3O0BOQLFgolKdcn7Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fSIz0bp6LgftNoGf4cDnyVrN1Nr/6IhpDhaD0QK7GmI=; b=bGY8FhZo1i9wAWqp/WZ4+zde0UXTOLC6tCXbPcoFCmDqzl1Nkl87h6jl5WoDKFog0U aWTO7h7w916Rko9QXD9CjB4u1ZX9dZahJkAeLXutEN9xQ/pNGIHeIgRFZkyUuAqrqfnY ox8FinVu/KJjQ6AEI4vQFCqpQQIyUE/tfT8oxcpTcY/qimbYNx3ROTD/TtAXdzYsGmbq c8pSofQoDPgCtIgfWdMTPCxo3ho9C+5GzzZMrtPfjJP+ZewW2PE4QYEPFm2Kzxj2P2ef 99AcCgYD14+cCL8db4yaN1vgv3nti0IlZyVh0vEITw/I3/QhDd1WZX7ODg5gc69m1tDt fHXA== X-Gm-Message-State: AKwxyteJiyYta1R7+VkTNx11selZ281/bGPwynDNDsMkl2t/+1SD12I6 rVWmawDTjitr/jCl44aw8a3dXQ== X-Received: by 10.223.188.6 with SMTP id s6mr7573533wrg.208.1517325846053; Tue, 30 Jan 2018 07:24:06 -0800 (PST) Received: from lmecxl0911.lme.st.com ([80.215.165.106]) by smtp.gmail.com with ESMTPSA id u79sm13253444wma.10.2018.01.30.07.24.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jan 2018 07:24:05 -0800 (PST) From: Benjamin Gaignard To: yannick.fertre@st.com, philippe.cornu@st.com, vincent.abriou@st.com, laurent.pinchart@ideasonboard.com Cc: airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Benjamin Gaignard Subject: [PATCH] drm/stm: check pitch and size calculations even if !CONFIG_MMU Date: Tue, 30 Jan 2018 16:24:00 +0100 Message-Id: <20180130152400.28972-1-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In all cases we have to check pitch and size calculations. Rely on drm_gem_cma_dumb_create for no MMU cases. Fixes: 21f815bf773c ("drm/stm: drv: Improve data transfers") Signed-off-by: Benjamin Gaignard --- drivers/gpu/drm/stm/drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.15.0 diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index 8bc7e8418b8d..3e0fb5f34b8e 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -44,9 +44,11 @@ static int stm_gem_cma_dumb_create(struct drm_file *file, */ args->pitch = roundup(min_pitch, 128); args->height = roundup(args->height, 4); -#endif return drm_gem_cma_dumb_create_internal(file, dev, args); +#else + return drm_gem_cma_dumb_create(file, dev, args); +#endif } DEFINE_DRM_GEM_CMA_FOPS(drv_driver_fops);