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: 10192003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4326D6020C for ; Tue, 30 Jan 2018 15:24:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3395428721 for ; Tue, 30 Jan 2018 15:24:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28067288D2; Tue, 30 Jan 2018 15:24:10 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 CFF4028721 for ; Tue, 30 Jan 2018 15:24:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ABD456E98E; Tue, 30 Jan 2018 15:24:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98FC56E98E for ; Tue, 30 Jan 2018 15:24:07 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id v15so11572671wrb.8 for ; Tue, 30 Jan 2018 07:24:07 -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=P+pnJeteIbXkSMt3ZMQ9RvQdUZhC7iUe2V0ZG3Iy0+bm6p+lHsmx+Y7B8aL7ox9k6g hF/P2aoXMYrTKjH+42I8hOD7f22+MvB6pRg7513qkCZS1xM1oQ4eA75ALEBlS2oCpspU bCPKE6pv6CYSXrhy/aYmpmmlzKFVkogFghYLGsgk54C+yCoSXOzDXE8R6KKbWb5Gl3pE ywx0/t/No05PfeEvUPPclxpu0As62HkalGom0xeqDssxklU8zDbyogGH1QOSw1rHeyUl fUNnj60UBks3N2AZwoa8kWpSCPoe0b2EHbKkZ7Z8rT5MGQAKN8zTs1IXV3in1pz5K+cU SFrA== X-Gm-Message-State: AKwxytf9KRKO3/ccaK910FG+NqgohSw8WoxDF5W61H9ea3iaMkqFM9zp 9jeRBTowgL3VpPNegQdVMqU6PQ== X-Google-Smtp-Source: AH8x227Srw0r17aiilpvu1fVo5K64vKBfuvHQGDSowpMsZX/3y4intL6cwvPhfreavFT6I54mtfnWQ== 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 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 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: airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);