From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 022A6C433C1 for ; Wed, 24 Mar 2021 10:53:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BE7761925 for ; Wed, 24 Mar 2021 10:53:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BE7761925 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=basnieuwenhuizen.nl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 597D26E9B8; Wed, 24 Mar 2021 10:53:43 +0000 (UTC) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by gabe.freedesktop.org (Postfix) with ESMTPS id 615796E9B4 for ; Wed, 24 Mar 2021 10:53:39 +0000 (UTC) Received: by mail-io1-xd36.google.com with SMTP id k25so8868985iob.6 for ; Wed, 24 Mar 2021 03:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basnieuwenhuizen.nl; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2whUJhCraBEtP2pdulfjOoK298h0/6QvmdXnzhHH7vY=; b=UP3R8Qy1B74mWtYoMs4KmmyNNnZDjyx4cg8jfeHBmLeQ9C5V4EAumFvnYR7WHCZXHO PXYWaK7U/XzZuYYZA7jETSkgdU9BCLgNo1/vHkAO3yPNed1SEdr/ntr7IQXtaycQqf74 OjBKsFciZiTrlzFqXabAiyD4dNd9y5mZlLwYIYI6QlOBOGjS+0ippiBt5HpXJugI/K45 TnvrAje6IMqRPZ5r3Av3Rv3SCj7gXSmNCWgB9wa4aOH9pZ78Cg9/Ced3776pqy8jHKBh mOD4KRipeNhYDZ3Spq64+DzYsIwtlwkNbFHdUY7pXZwj2B9avdqdwjCqLxF2Ww6eTdJQ Vrhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2whUJhCraBEtP2pdulfjOoK298h0/6QvmdXnzhHH7vY=; b=EpjZf9F3V5qgw6jLvugqKmqHIUuVdBHWDEss5rCErjLx43r6pSebLk93dV+/+Oqd5G NEPsIe/wZpEq/yGEs1BR0YaAa9bso5xHHw8rFQhp0R16v9BPrropaU5uV2q2zJksZUCD ZY7hKxjyTNMEJ6NNhqHH5yNBsvW+Wu+5ImL6h5i9e5GR447aacAVv6n4UX1LdwzQzTGP /rJr2SaFO1ndOzISPnPrWypPQDRvQjwSpbsDD1waZUHBh3fmxPBAtwIQ0gItQXJ8lRu6 biqjwgqnsWcMWy74/GCRjiYH3q2RrIqfo6xeFRW5I9LAqOu3OkyAx5fPkdJSgmG27jtt xC/Q== X-Gm-Message-State: AOAM5300O+KY5rxmUZnTAFOnfb7F0VfFq16ZqwEUMXabRrQJckvgVYf+ ByV6r8noBB2uAhyhwIKj3YtGZPNya3wC5ur9V/OsgQ== X-Google-Smtp-Source: ABdhPJyBSscQzBDgOrKAdPjSqblTlrU+heucKcUqaR0Wk2vuyrVYPA2N0/ZmH371HFYRWns+vzwNLrJbs//eNoIs9bQ= X-Received: by 2002:a5e:c908:: with SMTP id z8mr1959110iol.136.1616583218825; Wed, 24 Mar 2021 03:53:38 -0700 (PDT) MIME-Version: 1.0 References: <20210310161444.1015500-1-markyacoub@chromium.org> In-Reply-To: From: Bas Nieuwenhuizen Date: Wed, 24 Mar 2021 11:53:30 +0100 Message-ID: Subject: Re: [PATCH] drm/amdgpu: Ensure that the modifier requested is supported by plane. To: =?UTF-8?Q?Michel_D=C3=A4nzer?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Yacoub , Maling list - DRI developers , "Deucher, Alexander" , amd-gfx list , Mark Yacoub Content-Type: multipart/mixed; boundary="===============1355159342==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --===============1355159342== Content-Type: multipart/alternative; boundary="000000000000822d1105be461c77" --000000000000822d1105be461c77 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 24, 2021 at 11:13 AM Michel D=C3=A4nzer wr= ote: > On 2021-03-23 4:32 p.m., Mark Yacoub wrote: > > On Tue, Mar 23, 2021 at 11:02 AM Alex Deucher > wrote: > >> > >> On Wed, Mar 10, 2021 at 11:15 AM Mark Yacoub > wrote: > >>> > >>> From: Mark Yacoub > >>> > >>> On initializing the framebuffer, call drm_any_plane_has_format to do = a > >>> check if the modifier is supported. drm_any_plane_has_format calls > >>> dm_plane_format_mod_supported which is extended to validate that the > >>> modifier is on the list of the plane's supported modifiers. > >>> > >>> The bug was caught using igt-gpu-tools test: > kms_addfb_basic.addfb25-bad-modifier > >>> > >>> Tested on ChromeOS Zork by turning on the display, running an overlay > >>> test, and running a YT video. > >>> > >>> Cc: Alex Deucher > >>> Cc: Bas Nieuwenhuizen > >>> Signed-off-by: default avatarMark Yacoub > >> > >> I'm not an expert with modifiers yet. Will this break chips which > >> don't currently support modifiers? > > No it shouldn't. When you don't support modifiers yet, your will > > default to Linear Modifier (DRM_FORMAT_MOD_LINEAR), > > [...] > No modifier support does not imply linear. It's generally signalled via > DRM_FORMAT_MOD_INVALID, which roughly means "tiling is determined by driv= er > specific mechanisms". > Doesn't quite work that way in the kernel sadly. If you don't set DRM_MODE_FB_MODIFIERS then the modifier fields have to be 0 (which happens to alias DRM_FORMAT_MOD_LINEAR and then now deprecated DRM_FORMAT_MOD_NONE). This is verified in shared drm code. (and all userspace code I've seen simply doesn't set DRM_MODE_FB_MODIFIERS if the incoming modifier is DRM_FORMAT_MOD_INVALID) > > > -- > Earthling Michel D=C3=A4nzer | https://redhat= .com > Libre software enthusiast | Mesa and X developer > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > --000000000000822d1105be461c77 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Mar 24, 2021 at 11:13 AM Mich= el D=C3=A4nzer <michel@daenzer.net= > wrote:
= On 2021-03-23 4:32 p.m., Mark Yacoub wrote:
> On Tue, Mar 23, 2021 at 11:02 AM Alex Deucher <alexdeucher@gmail.com> wrote:=
>>
>> On Wed, Mar 10, 2021 at 11:15 AM Mark Yacoub <markyacoub@chromium.org>= wrote:
>>>
>>> From: Mark Yacoub <markyacoub@google.com>
>>>
>>> On initializing the framebuffer, call drm_any_plane_has_format= to do a
>>> check if the modifier is supported. drm_any_plane_has_format c= alls
>>> dm_plane_format_mod_supported which is extended to validate th= at the
>>> modifier is on the list of the plane's supported modifiers= .
>>>
>>> The bug was caught using igt-gpu-tools test: kms_addfb_basic.a= ddfb25-bad-modifier
>>>
>>> Tested on ChromeOS Zork by turning on the display, running an = overlay
>>> test, and running a YT video.
>>>
>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
>>> Signed-off-by: default avatarMark Yacoub <markyacoub@chromium.org>=
>>
>> I'm not an expert with modifiers yet.=C2=A0 Will this break ch= ips which
>> don't currently support modifiers?
> No it shouldn't. When you don't support modifiers yet, your wi= ll
> default to Linear Modifier (DRM_FORMAT_MOD_LINEAR),
> [...]
No modifier support does not imply linear. It's generally signalled via= DRM_FORMAT_MOD_INVALID, which roughly means "tiling is determined by = driver specific mechanisms".

Doesn= 't quite work that way in the kernel sadly. If you don't set DRM_MO= DE_FB_MODIFIERS then the modifier fields have to be 0 (which happens to ali= as DRM_FORMAT_MOD_LINEAR and then now deprecated DRM_FORMAT_MOD_NONE). This= is verified in shared drm code.

(and all userspac= e code I've seen simply doesn't set DRM_MODE_FB_MODIFIERS if the in= coming modifier is DRM_FORMAT_MOD_INVALID)


--
Earthling Michel D=C3=A4nzer=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0https://redhat= .com
Libre software enthusiast=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@= lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo= /amd-gfx
--000000000000822d1105be461c77-- --===============1355159342== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1355159342==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12815C433DB for ; Wed, 24 Mar 2021 10:53:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3700C61993 for ; Wed, 24 Mar 2021 10:53:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3700C61993 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=basnieuwenhuizen.nl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D90576E200; Wed, 24 Mar 2021 10:53:39 +0000 (UTC) Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 555AC6E200 for ; Wed, 24 Mar 2021 10:53:39 +0000 (UTC) Received: by mail-io1-xd2e.google.com with SMTP id x16so20977136iob.1 for ; Wed, 24 Mar 2021 03:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basnieuwenhuizen.nl; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2whUJhCraBEtP2pdulfjOoK298h0/6QvmdXnzhHH7vY=; b=UP3R8Qy1B74mWtYoMs4KmmyNNnZDjyx4cg8jfeHBmLeQ9C5V4EAumFvnYR7WHCZXHO PXYWaK7U/XzZuYYZA7jETSkgdU9BCLgNo1/vHkAO3yPNed1SEdr/ntr7IQXtaycQqf74 OjBKsFciZiTrlzFqXabAiyD4dNd9y5mZlLwYIYI6QlOBOGjS+0ippiBt5HpXJugI/K45 TnvrAje6IMqRPZ5r3Av3Rv3SCj7gXSmNCWgB9wa4aOH9pZ78Cg9/Ced3776pqy8jHKBh mOD4KRipeNhYDZ3Spq64+DzYsIwtlwkNbFHdUY7pXZwj2B9avdqdwjCqLxF2Ww6eTdJQ Vrhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2whUJhCraBEtP2pdulfjOoK298h0/6QvmdXnzhHH7vY=; b=mKfd4ev5iRSGepCBmEOaSUaPu+iCo3goExtTaSvsMiD/o/RzLUEPgpgZkyM9Ly8dl/ CcxjF9VbXbtLPtJlhO3xZhFCG9AXKttUY3EO1akTDzVMqNKLAgDl5yGVse2mMerYwsvd K5gmVOTiqxQ38r8kTglLZNtf2evbrPrm2sAdbXgkd8zWmuojSaXVJIJzlbCU1jK0JCgX hGRAGd79HTUs1tZA25rp10DpQnk+QovE6VTZ81I3Ng9bH3jOqasFVpW6tbk3yiF01gs0 lCezS7KtBEdVbhLmmvQN903v7QM1XlIXZcQ4MpluAyR5nbSw27TRECQoR1mAM+CUtdfk tXuQ== X-Gm-Message-State: AOAM530JGt9wIh+GilPFPkNIuAhzX+52QKllQtjEWUySkd6V7TfqoyHH Z1gy4QP3w74I9UugD/gxDOeynRQp4TaRkiFEFvIv2g== X-Google-Smtp-Source: ABdhPJyBSscQzBDgOrKAdPjSqblTlrU+heucKcUqaR0Wk2vuyrVYPA2N0/ZmH371HFYRWns+vzwNLrJbs//eNoIs9bQ= X-Received: by 2002:a5e:c908:: with SMTP id z8mr1959110iol.136.1616583218825; Wed, 24 Mar 2021 03:53:38 -0700 (PDT) MIME-Version: 1.0 References: <20210310161444.1015500-1-markyacoub@chromium.org> In-Reply-To: From: Bas Nieuwenhuizen Date: Wed, 24 Mar 2021 11:53:30 +0100 Message-ID: Subject: Re: [PATCH] drm/amdgpu: Ensure that the modifier requested is supported by plane. To: =?UTF-8?Q?Michel_D=C3=A4nzer?= X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Yacoub , Maling list - DRI developers , "Deucher, Alexander" , amd-gfx list , Alex Deucher , Mark Yacoub Content-Type: multipart/mixed; boundary="===============0111436028==" Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" --===============0111436028== Content-Type: multipart/alternative; boundary="000000000000822d1105be461c77" --000000000000822d1105be461c77 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 24, 2021 at 11:13 AM Michel D=C3=A4nzer wr= ote: > On 2021-03-23 4:32 p.m., Mark Yacoub wrote: > > On Tue, Mar 23, 2021 at 11:02 AM Alex Deucher > wrote: > >> > >> On Wed, Mar 10, 2021 at 11:15 AM Mark Yacoub > wrote: > >>> > >>> From: Mark Yacoub > >>> > >>> On initializing the framebuffer, call drm_any_plane_has_format to do = a > >>> check if the modifier is supported. drm_any_plane_has_format calls > >>> dm_plane_format_mod_supported which is extended to validate that the > >>> modifier is on the list of the plane's supported modifiers. > >>> > >>> The bug was caught using igt-gpu-tools test: > kms_addfb_basic.addfb25-bad-modifier > >>> > >>> Tested on ChromeOS Zork by turning on the display, running an overlay > >>> test, and running a YT video. > >>> > >>> Cc: Alex Deucher > >>> Cc: Bas Nieuwenhuizen > >>> Signed-off-by: default avatarMark Yacoub > >> > >> I'm not an expert with modifiers yet. Will this break chips which > >> don't currently support modifiers? > > No it shouldn't. When you don't support modifiers yet, your will > > default to Linear Modifier (DRM_FORMAT_MOD_LINEAR), > > [...] > No modifier support does not imply linear. It's generally signalled via > DRM_FORMAT_MOD_INVALID, which roughly means "tiling is determined by driv= er > specific mechanisms". > Doesn't quite work that way in the kernel sadly. If you don't set DRM_MODE_FB_MODIFIERS then the modifier fields have to be 0 (which happens to alias DRM_FORMAT_MOD_LINEAR and then now deprecated DRM_FORMAT_MOD_NONE). This is verified in shared drm code. (and all userspace code I've seen simply doesn't set DRM_MODE_FB_MODIFIERS if the incoming modifier is DRM_FORMAT_MOD_INVALID) > > > -- > Earthling Michel D=C3=A4nzer | https://redhat= .com > Libre software enthusiast | Mesa and X developer > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > --000000000000822d1105be461c77 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Mar 24, 2021 at 11:13 AM Mich= el D=C3=A4nzer <michel@daenzer.net= > wrote:
= On 2021-03-23 4:32 p.m., Mark Yacoub wrote:
> On Tue, Mar 23, 2021 at 11:02 AM Alex Deucher <alexdeucher@gmail.com> wrote:=
>>
>> On Wed, Mar 10, 2021 at 11:15 AM Mark Yacoub <markyacoub@chromium.org>= wrote:
>>>
>>> From: Mark Yacoub <markyacoub@google.com>
>>>
>>> On initializing the framebuffer, call drm_any_plane_has_format= to do a
>>> check if the modifier is supported. drm_any_plane_has_format c= alls
>>> dm_plane_format_mod_supported which is extended to validate th= at the
>>> modifier is on the list of the plane's supported modifiers= .
>>>
>>> The bug was caught using igt-gpu-tools test: kms_addfb_basic.a= ddfb25-bad-modifier
>>>
>>> Tested on ChromeOS Zork by turning on the display, running an = overlay
>>> test, and running a YT video.
>>>
>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
>>> Signed-off-by: default avatarMark Yacoub <markyacoub@chromium.org>=
>>
>> I'm not an expert with modifiers yet.=C2=A0 Will this break ch= ips which
>> don't currently support modifiers?
> No it shouldn't. When you don't support modifiers yet, your wi= ll
> default to Linear Modifier (DRM_FORMAT_MOD_LINEAR),
> [...]
No modifier support does not imply linear. It's generally signalled via= DRM_FORMAT_MOD_INVALID, which roughly means "tiling is determined by = driver specific mechanisms".

Doesn= 't quite work that way in the kernel sadly. If you don't set DRM_MO= DE_FB_MODIFIERS then the modifier fields have to be 0 (which happens to ali= as DRM_FORMAT_MOD_LINEAR and then now deprecated DRM_FORMAT_MOD_NONE). This= is verified in shared drm code.

(and all userspac= e code I've seen simply doesn't set DRM_MODE_FB_MODIFIERS if the in= coming modifier is DRM_FORMAT_MOD_INVALID)


--
Earthling Michel D=C3=A4nzer=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0https://redhat= .com
Libre software enthusiast=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@= lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo= /amd-gfx
--000000000000822d1105be461c77-- --===============0111436028== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx --===============0111436028==--