Received: by 10.223.176.5 with SMTP id f5csp4146001wra; Tue, 30 Jan 2018 02:52:07 -0800 (PST) X-Google-Smtp-Source: AH8x224/YBsMaWadEDbj/TfrybFrNyodMsnJ79EmO7GYjU3PyidIsL1dgcTg8i5OHX9sQBCuKlLS X-Received: by 10.98.98.1 with SMTP id w1mr22597523pfb.9.1517309527168; Tue, 30 Jan 2018 02:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517309527; cv=none; d=google.com; s=arc-20160816; b=ifD2weJ/BW1t/YFdvBwg8zvRVb/zCGZZ3PggGBTM5xNs6bDZ5EQj4yL3EJBIrRZV9d oJzUXnlUEU+Llb9dR3vzBwoXkIg6T8XfSuQ9qOLWZ2ySniRtB99mZfwhsE6m03CAj3Te uN23D1QR3s4MD7QWvgc31C1iU30UP9SkxgWb55PIkrUOd8JnGdg60mwxsYDt0QCVJbEm C6UeActrTHBH6TDRmq8ed52oztqoNNSgbN677rk6B2TOSTMX/FtJfjiTZeyvnuFrnJ1W UMPBnGn/3XGJZGtaSvJP2ISTfsmjJSnHsNdbeLqa7RyBO7t6Ovu5j9O2Uos/0jRpFZdH KdIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=sPqh8gWGTfpnMhowfwxKCljItE34ZbIvRx9shIp5uPE=; b=CPwOsp4dC8IAaA+7cTIq4PHDhO+fBZEiUx16Gfq974CuLVYiNosYvywEYbH9+70qyO ZpOSmAr3EkLft2/JGhK/ZhQwvWLK2JWuJuc6rXcKLLjQ6PA5h2BXn+XBiO6bJz8xQNfG EsMcJ/vK8KQSMIcV/dTzUBRvA8ADusbS+4d5Rwi9Vah30EDcmqEwgajFiZOuXS0TmokY lCwtLEzwxlS1fmZkjxAKqMjd0nNHM8S7sFTxfTPhFmgg5Ht/fNh6XHtXWXKqTW2nA4z8 dcS19GG7/ZaGD6QPY6zHwIAgl9BuqrbHnnUamIgK6DKSdAXJDgFTU/9tGIlX3F6Z/635 VxkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DodHNiTk; 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 i3-v6si1838278pld.723.2018.01.30.02.51.52; Tue, 30 Jan 2018 02:52:07 -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=DodHNiTk; 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 S1751670AbeA3Kv2 (ORCPT + 99 others); Tue, 30 Jan 2018 05:51:28 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:38224 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556AbeA3Kv1 (ORCPT ); Tue, 30 Jan 2018 05:51:27 -0500 Received: by mail-qk0-f196.google.com with SMTP id t134so9481023qke.5 for ; Tue, 30 Jan 2018 02:51:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sPqh8gWGTfpnMhowfwxKCljItE34ZbIvRx9shIp5uPE=; b=DodHNiTk3DzusXpRmIrlNCDeHorIIc33w72jvHagWNAljrxjykMVUjhfbaDhTiEMaM gvSyldB+cXouxH82WWbU8SktepVukCyc/qzpzaWYkvdUWCunqwqYV+cgzuDiG+tUkS4d lD4In8uJFv5k8PvKzmQxsXv1tNo2S71DXEIug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sPqh8gWGTfpnMhowfwxKCljItE34ZbIvRx9shIp5uPE=; b=CZYJVrHjHBxHm2tpvJ/WKVh2+NlLmiZQB7WpsewQlMH97RG9W84mtKhswJM9dELlU7 ANDRdGBo2KSufKpVvxEmEMO9vNOh+akff7qbtpxusJf3djupib8kboQatwos/ZLq96JD nJ6K4tcub4kX6H75lfQlujmwMme7JgvEED/k5u6zPTxid7dAhsz4oZwhZReaLoX6y01v wQfLylGgHuRuCSuQtRmjbK4h3RyjQzmrLMxGHQbkVxdApBlO9kkyG0M/MRB4/579gfBO Qx57uRkV7pnZaSQWlQdCIl1yT1AIpC7c765GgZ7c/tI+Gc9HiOjAhj+YjSO+JVs7j2PJ b/5Q== X-Gm-Message-State: AKwxytdUntvn5SCJGJBLZ3qjYjBOupEUqSBn7GC/ggoLZ39bRE0frfWd VnI26DDZjIjLN1dHkYbZn2ZVWYK8aDzSENMPPZhosQ== X-Received: by 10.233.221.197 with SMTP id r188mr42001558qkf.107.1517309486260; Tue, 30 Jan 2018 02:51:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.82.178 with HTTP; Tue, 30 Jan 2018 02:51:25 -0800 (PST) In-Reply-To: <20180130104200.21602-1-philippe.cornu@st.com> References: <20180130104200.21602-1-philippe.cornu@st.com> From: Benjamin Gaignard Date: Tue, 30 Jan 2018 11:51:25 +0100 Message-ID: Subject: Re: [PATCH v2] drm/stm: drv: Improve data transfers To: Philippe Cornu Cc: Yannick Fertre , Vincent Abriou , David Airlie , dri-devel@lists.freedesktop.org, Linux Kernel Mailing List , Archit Taneja , Andrzej Hajda , Laurent Pinchart , Fabien Dessenne , Mickael Reulier , Ludovic Barre , Alexandre Torgue , Maxime Coquelin Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-01-30 11:42 GMT+01:00 Philippe Cornu : > To optimize data transfers, align pitch on 128 bytes & height > on 4 bytes. This optimization is not applicable on hw without MMU. > > Signed-off-by: Yannick Fertre > Signed-off-by: Vincent Abriou > Signed-off-by: Philippe Cornu Applied on drm-misc-next. Regards, Benjamin > --- > Changes in v2: Rename stm_dumb_create() to stm_gem_cma_dumb_create() and > move CONFIG_MMU inside the function following comments from Benjamin > Gaignard. > > drivers/gpu/drm/stm/drv.c | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c > index 8fe954c27fba..8bc7e8418b8d 100644 > --- a/drivers/gpu/drm/stm/drv.c > +++ b/drivers/gpu/drm/stm/drv.c > @@ -31,6 +31,24 @@ static const struct drm_mode_config_funcs drv_mode_config_funcs = { > .atomic_commit = drm_atomic_helper_commit, > }; > > +static int stm_gem_cma_dumb_create(struct drm_file *file, > + struct drm_device *dev, > + struct drm_mode_create_dumb *args) > +{ > +#ifdef CONFIG_MMU > + unsigned int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8); > + > + /* > + * in order to optimize data transfer, pitch is aligned on > + * 128 bytes, height is aligned on 4 bytes > + */ > + args->pitch = roundup(min_pitch, 128); > + args->height = roundup(args->height, 4); > +#endif > + > + return drm_gem_cma_dumb_create_internal(file, dev, args); > +} > + > DEFINE_DRM_GEM_CMA_FOPS(drv_driver_fops); > > static struct drm_driver drv_driver = { > @@ -44,7 +62,7 @@ static struct drm_driver drv_driver = { > .minor = 0, > .patchlevel = 0, > .fops = &drv_driver_fops, > - .dumb_create = drm_gem_cma_dumb_create, > + .dumb_create = stm_gem_cma_dumb_create, > .prime_handle_to_fd = drm_gem_prime_handle_to_fd, > .prime_fd_to_handle = drm_gem_prime_fd_to_handle, > .gem_free_object_unlocked = drm_gem_cma_free_object, > -- > 2.15.1 >