Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1619175rwb; Sun, 14 Aug 2022 08:05:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR5QwKbsvq7VpGwD/CfUH+Bho49Rj73E0FvFP2dIg56GLa/pYdRIhDjHFETPwTi3ivpYB/vN X-Received: by 2002:a17:90b:1c90:b0:1f8:42dd:9eba with SMTP id oo16-20020a17090b1c9000b001f842dd9ebamr23018941pjb.160.1660489530884; Sun, 14 Aug 2022 08:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660489530; cv=none; d=google.com; s=arc-20160816; b=YqcZV2NTxLV6b881h2O6xdcDjp7vTKA+KYU0ZQnZewcvoOuZfZCQxiGcowE7SK/roM YywP1Qxx3xPTh3T0qRAKwoOLffOIusv7ssZRndvNZ+kXgiQTJr/1dgT1WAOmZwnYGWmf 6wjcNDCfW8MwPqLsufXlqvsm26Nv9htXezDAYxk6yhdabolJ9svvlSRpEWAJ2cF/yZaH Ei9e8dZmrsDW/mt+xuFrUnHvSTrjWbA5+iWdYdjLM/dHWhClakPTPuJsFsifqxf5BX8g jzVKsYOMdS0t+qTjKoYB4Aq+gooZZX7P0uNquL9Psl1UJAXg7VGHz2HnyipKQo5zwDzM VpBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=BDAVIhnSkgENDUQ7IfYC3/2QkAEAsNSSEneZku1M24s=; b=bAtjcF2uraRbf4uMCvyqok+QSn81J3vNqk0REhce0N/fZP5HT9jl9YgMIpQnjBVvCl d5BTgLdgfB3eKtz7+vzt1qQyLYcQrQ7/Adsa+ky7U2m9pWjkwlNOn/kOGt9fvGjrcu44 cMegMfe7Eed/H1VSq6XuoNzt7gC8zVSapBS3En4ljLgevGRAlyzMEBrRSeKmJu+r1KT6 yFo6uuN6aTHKhlm6kcGwRrpyAV0PZnOp1QztCUGd2KXMEfV60V6XTaMOrmyNygtWqqG2 CrO98EmerfSEdkefHAuGcydCFuV1L+o3cXqsOCan6OiaO8+/Z2/i3NSkAQJXVyQQDOCO h1QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p0gfoBw4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n17-20020a170903111100b0016d2ef2b7bfsi9584056plh.424.2022.08.14.08.05.05; Sun, 14 Aug 2022 08:05:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p0gfoBw4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S239694AbiHNO1n (ORCPT + 99 others); Sun, 14 Aug 2022 10:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbiHNO1l (ORCPT ); Sun, 14 Aug 2022 10:27:41 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EACF911C27 for ; Sun, 14 Aug 2022 07:27:39 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id 11so822025ybu.0 for ; Sun, 14 Aug 2022 07:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=BDAVIhnSkgENDUQ7IfYC3/2QkAEAsNSSEneZku1M24s=; b=p0gfoBw4ZgOT1ksw69dVgdZR0JT7daeCJ16dH8wcxMLnRGqjA3uhDchB1lA7TQfaYX BrQw9XUmookElN0tbP/iD4tNxHbscwSregEaqi3xk9KU+HnauYP7IDU38X3ZZJGiM3hc 2cUIIAVEHjFscy2B3j5HOgzkZTsMCx9rw/txu7rZ55uaJm4jlwQc7RspbXg/YAloW0C/ 0svWUNrFbrZiZ7KzaV5kWEWoFtC/V4k27Ur2X/IFi253YZhnsFFyEBoQ+jjOu06CSB77 L5qDaCYzVqdwx8ZM/qx64yS4r691EzmylMr4OT3lTcBSK98a1Kt2wCd0iOF2OHsyy1IV Yv8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=BDAVIhnSkgENDUQ7IfYC3/2QkAEAsNSSEneZku1M24s=; b=h8irLGKgl7i64g4joOVZhXaoQYLYl32+tSfAC+TcfRz+dgTiOxUPW2cXf42nYrPWMH +OiNfuvMjQ5YCGFOwmDhgg12b4efiYiSmml1/nus4b6+rHd+FwgitN4xp8xgJriL3Ndg UorelNW8bjR/dr3oMNMfF8643FaVjA/XYotyu9Xr+aKl1SpsroFXS497n0VeaEsk8YTR F2c7Km+BFB1msTdmJ9Nydemuh6ode3RX8jkYxVjxCxaEaOzqeHwii8DTpg4qHmu3+peN VbgubKqciSFUdxuWHhvsuy5Nma0ONBw8Sr8AXMisqfvCCWC2v55Mek6Kpu6LqTMs8edB dIhw== X-Gm-Message-State: ACgBeo0X+ewGpCL8moUt/3R6BSC49IoRX98iLjk/oHiYyu2WjHJnUMIg XiPymCugeFR64tAdJhDF3cYJLVShD1U7vvxulp7Pvw== X-Received: by 2002:a25:cb05:0:b0:67c:29a8:cb9c with SMTP id b5-20020a25cb05000000b0067c29a8cb9cmr9640988ybg.135.1660487259148; Sun, 14 Aug 2022 07:27:39 -0700 (PDT) MIME-Version: 1.0 References: <1642587791-13222-1-git-send-email-ivo.g.dimitrov.75@gmail.com> <1642587791-13222-4-git-send-email-ivo.g.dimitrov.75@gmail.com> <5b6d3e7f-c638-fdc7-5080-44d34abed610@ideasonboard.com> In-Reply-To: From: Yongqin Liu Date: Sun, 14 Aug 2022 22:27:27 +0800 Message-ID: Subject: Re: [PATCH 3/3] drm: omapdrm: Do no allocate non-scanout GEMs through DMM/TILER To: Ivaylo Dimitrov Cc: Tomi Valkeinen , tomba@kernel.org, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, merlijn@wizzup.org, tony@atomide.com, "Bajjuri, Praneeth" , Sumit Semwal Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, IvayIo Thanks very much for the reply! On Sat, 13 Aug 2022 at 14:58, Ivaylo Dimitrov wrote: > > Hi Liu, > > On 12.08.22 =D0=B3. 7:35 =D1=87., Yongqin Liu wrote: > > Hi, Ivaylo, Tomi > > > > We have one X15 Android AOSP master build, it could not have the home > > screen displayed > > on the hdmi monitor connected with this change, with the following > > message printed on the serial console > > [ 607.404205] omapdrm omapdrm.0: Failed to setup plane plane-0 > > [ 607.410522] omapdrm omapdrm.0: Failed to setup plane plane-1 > > [ 607.416381] omapdrm omapdrm.0: Failed to setup plane plane-2 > > [ 607.422088] omapdrm omapdrm.0: Failed to setup plane plane-3 > > > > # for details, please check the link here: http://ix.io/47m1 > > > > It will work with home screen displayed on the hdmi monitor if this > > change is reverted. > > > > Is this the broken problem you talked about here? > > > > And could you please give some suggestions on how to have the x15 > > Android build work with this change? > > > > Make sure scanout (i.e. those to be displayed) buffers are actually > allocated as such - OMAP_BO_SCANOUT flag must be set when calling > omap_bo_new(). I am not familiar with this area, I am sorry if I asked quite silly questio= ns:( I googled omap_bo_new, and found it's a function of libdrm here[1], is it what you meant here? If it's the omap_bo_new that we should pass OMAP_BO_SCANOUT when it is call= ed, then is it the correct way to update omap_bo_new to add the OMAP_BO_SCANOUT= flag before it calls omap_bo_new_impl? And another question is that, since the userspace(libdrm) will be used to work with different kernel versions, like the old 4.14, 4.19, etc, do you think there will be problem to pass OMAP_BO_SCANOUT from the userspace side with the old kernels(which does not have this chang= e)? does this change need to be backported to the old kernel versions? And the last question is that, omap_bo_new might be called by some property binaries what not everyone could get the source to update, for such case what's your suggestions? [1]: https://gitlab.freedesktop.org/mesa/drm/-/blob/main/omap/omap_drm.c#L2= 27 Thanks, Yongqin Liu > > On Thu, 17 Feb 2022 at 23:29, Ivaylo Dimitrov > > wrote: > >> > >> > >> > >> On 17.02.22 =D0=B3. 14:46 =D1=87., Tomi Valkeinen wrote: > >>> Hi, > >>> > >>> On 19/01/2022 12:23, Ivaylo Dimitrov wrote: > >>>> On devices with DMM, all allocations are done through either DMM or > >>>> TILER. > >>>> DMM/TILER being a limited resource means that such allocations will = start > >>>> to fail before actual free memory is exhausted. What is even worse i= s > >>>> that > >>>> with time DMM/TILER space gets fragmented to the point that even if = we > >>>> have > >>>> enough free DMM/TILER space and free memory, allocation fails becaus= e > >>>> there > >>>> is no big enough free block in DMM/TILER space. > >>>> > >>>> Such failures can be easily observed with OMAP xorg DDX, for example= - > >>>> starting few GUI applications (so buffers for their windows are > >>>> allocated) > >>>> and then rotating landscape<->portrait while closing and opening new > >>>> windows soon results in allocation failures. > >>>> > >>>> Fix that by mapping buffers through DMM/TILER only when really neede= d, > >>>> like, for scanout buffers. > >>> > >>> Doesn't this break users that get a buffer from omapdrm and expect it= to > >>> be contiguous? > >>> > >> > >> If you mean dumb buffer, then no, this does not break users as dumb > >> buffers are allocated as scanout: > >> > >> https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/omapdrm= /omap_gem.c#L603 > >> > >> If you mean omap_bo allocated buffers, then if users want > >> linear(scanout) buffer, then they request it explicitly by passing > >> OMAP_BO_SCANOUT. > >> > >> Ivo > > > > > > --=20 Best Regards, Yongqin Liu --------------------------------------------------------------- #mailing list linaro-android@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-android