Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2222501ybd; Mon, 24 Jun 2019 02:50:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0VnVB8FVo3xnjXtN8oT7piLCiR6PIMngQIt3HfoF9EFOvH/VD1Rq2W2Jc5yiPG/SprA7F X-Received: by 2002:a63:1a5e:: with SMTP id a30mr31208645pgm.433.1561369802270; Mon, 24 Jun 2019 02:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561369802; cv=none; d=google.com; s=arc-20160816; b=rWjQmYwYpqQ49Kw60XwyFzhj50EfS9KXplUoMaeNFXQ2rUoNlx7vh0oW8I1FHgSUpu enmfNVzgRKhYr2+XWzbnBJb83EIiDqJDItR2RFwcCfGvtYC9HBRI8JYCOX9BiUkw8Gdw G52mjptjF+VRX6SHH/66j6s1OAdEcSuUY5ojDJkAXiXEuNn7FyKEobU4yOpXhdS9IU2I KRb+8M/cFE+xc737Ex/alKyNAvcdQ/6bjmC7Y8XP9l/D51/UDlgWnmonevKckZwk0iT5 U5IZHN6RiIy4/zA5X9dz1lon3rlzOiMtqqA+Y+gM0Qv+0NXQsEJdsenKf+Rj5N6RCCg2 XciA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:nodisclaimer:user-agent:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from:dkim-signature; bh=Iv5Xqog5f/Dc9maPP2LdqiIYxbtPDzmV6HbKrukCNDU=; b=1E6DaRASbIWcyNxVj3Tyb0jAF6WnhilIgI4j+pkXC6orG2gxPb7yg8CuoK/VzVvxyu yJZw20guo92Fkw9C7H6qPKqR1Ef0JO8yBcUkLc+Qt9GLN39WR5eFoj2gqkcyYwPSwVQ8 O5q+4TLUyWEwyD9xG315MkksShhwGTrmLwd5CPAhj8Nze6KO5AJQp3eOmSYojJmFUuJx dY7hJXwesph4lXuN1334XvjBlzBV4VcnN42sVop05aL+35axaAPj0NmGwbGGKBSkCXyg JEyKUHL0pehVc6rVhfST7M5EBRBDOhGF08w36mqARnS+f86UWvgKOROKXmoYgeBA+pd4 YZ6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=0HT1Uv1I; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si10869891pfa.223.2019.06.24.02.49.46; Mon, 24 Jun 2019 02:50:02 -0700 (PDT) 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=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=0HT1Uv1I; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728162AbfFXJck (ORCPT + 99 others); Mon, 24 Jun 2019 05:32:40 -0400 Received: from mail-eopbgr70084.outbound.protection.outlook.com ([40.107.7.84]:58624 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726331AbfFXJck (ORCPT ); Mon, 24 Jun 2019 05:32:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Iv5Xqog5f/Dc9maPP2LdqiIYxbtPDzmV6HbKrukCNDU=; b=0HT1Uv1IdM8VE0Nc4gRRUPkJhD7Y9Z5cqIQop2EPOXpLUYMZjLtmLAAbqa1/CXbs0kC/UjuYaBXnNYJBMZedD5UmDHZUOWmG2ItcTggobOYb2XC0z2gi7/1YPkujY89IZH0NnOtgNsxQBTKVL95ELntOmnG1QUlM6yvMVC1cFow= Received: from VI1PR08MB3696.eurprd08.prod.outlook.com (20.178.13.156) by VI1PR08MB3118.eurprd08.prod.outlook.com (52.133.15.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.15; Mon, 24 Jun 2019 09:32:35 +0000 Received: from VI1PR08MB3696.eurprd08.prod.outlook.com ([fe80::f00e:b5de:6aa:4a64]) by VI1PR08MB3696.eurprd08.prod.outlook.com ([fe80::f00e:b5de:6aa:4a64%6]) with mapi id 15.20.2008.014; Mon, 24 Jun 2019 09:32:35 +0000 From: Brian Starkey To: Daniel Vetter CC: Raymond Smith , "maarten.lankhorst@linux.intel.com" , "maxime.ripard@bootlin.com" , "sean@poorly.run" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "yuq825@gmail.com" , Ayan Halder , "malidp@foss.arm.com" , nd Subject: Re: [PATCH] drm/fourcc: Add Arm 16x16 block modifier Thread-Topic: [PATCH] drm/fourcc: Add Arm 16x16 block modifier Thread-Index: AQHVKBsKBvRwqAaS30eXmbt21cTJQqamO1MAgART94A= Date: Mon, 24 Jun 2019 09:32:35 +0000 Message-ID: <20190624093233.73f3tcshewlbogli@DESKTOP-E1NTVVP.localdomain> References: <1561112433-5308-1-git-send-email-raymond.smith@arm.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: NeoMutt/20180716-849-147d51-dirty x-originating-ip: [217.140.106.55] x-clientproxiedby: LO2P265CA0086.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::26) To VI1PR08MB3696.eurprd08.prod.outlook.com (2603:10a6:803:b6::28) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Brian.Starkey@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d5c4cdfa-ffeb-40fa-6607-08d6f886e3be x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:VI1PR08MB3118; x-ms-traffictypediagnostic: VI1PR08MB3118: x-ms-exchange-purlcount: 1 nodisclaimer: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(136003)(396003)(366004)(376002)(346002)(199004)(189003)(66476007)(53936002)(7736002)(6486002)(102836004)(99286004)(52116002)(14454004)(6506007)(81166006)(8676002)(72206003)(81156014)(76176011)(316002)(6916009)(8936002)(53546011)(44832011)(26005)(966005)(6246003)(476003)(2906002)(54906003)(186003)(11346002)(486006)(446003)(58126008)(9686003)(6116002)(3846002)(6512007)(256004)(229853002)(305945005)(6436002)(1076003)(14444005)(386003)(25786009)(478600001)(6306002)(5660300002)(71200400001)(66066001)(68736007)(66446008)(86362001)(66556008)(71190400001)(4326008)(73956011)(64756008)(66946007);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR08MB3118;H:VI1PR08MB3696.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: UoPjhhq+tJbmaI6exE1fk9ud0O9pG/XLf2tS1mHYFeGaLBU3Rmnq7dXBY/ieKDm6Cjx/llt0iD2kl4DhV0XM1pLmb3n8DX96MAiff60+aiuEZfRQ+sc4D9nJrwbDXIv8JJeZ16M3hrzsSLDBNz3rPMShFQvFjhgGLe0vbUSGSnW9VNYnEYJMgMRFk6Ve0tqYxA/H1825sM3zjAvs3h5+etn7Bk1XZBqHekhHSoqA3HgxACSE8wwOCihXu7PM+41dJ3Mgh8lt3SdID1DxdblGykAtXKC4Txx+B+pNIzbVEdKwQ/+FihQEX2QyIGTzLExVEL3F733c31Qb1Hg3eWZlPX3GO0UiutmHcmJqcFCZ711YhNYJZ83+OHr+eubcUobet8o7W17pTw8ECvHlQKELIGjBdi4jTU4jzulAULuYZA8= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5c4cdfa-ffeb-40fa-6607-08d6f886e3be X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 09:32:35.3533 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Brian.Starkey@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3118 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, On Fri, Jun 21, 2019 at 05:27:00PM +0200, Daniel Vetter wrote: > On Fri, Jun 21, 2019 at 12:21 PM Raymond Smith wr= ote: > > > > Add the DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED modifier to > > denote the 16x16 block u-interleaved format used in Arm Utgard and > > Midgard GPUs. > > > > Signed-off-by: Raymond Smith > > --- > > include/uapi/drm/drm_fourcc.h | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourc= c.h > > index 3feeaa3..8ed7ecf 100644 > > --- a/include/uapi/drm/drm_fourcc.h > > +++ b/include/uapi/drm/drm_fourcc.h > > @@ -743,6 +743,16 @@ extern "C" { > > #define AFBC_FORMAT_MOD_BCH (1ULL << 11) > > > > /* > > + * Arm 16x16 Block U-Interleaved modifier > > + * > > + * This is used by Arm Mali Utgard and Midgard GPUs. It divides the im= age > > + * into 16x16 pixel blocks. Blocks are stored linearly in order, but p= ixels > > + * in the block are reordered. > > + */ > > +#define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \ > > + fourcc_mod_code(ARM, ((1ULL << 55) | 1)) >=20 > This seems to be an extremely random pick for a new number. What's the > thinking here? Aside from "doesnt match any of the afbc combos" ofc. > If you're already up to having thrown away 55bits, then it's not going > to last long really :-) >=20 > I think a good idea would be to reserve a bunch of the high bits as > some form of index (afbc would get index 0 for backwards compat). And > then the lower bits would be for free use for a given index/mode. And > the first mode is probably an enumeration, where possible modes simple > get enumerated without further flags or anything. Yup, that's the plan: (0 << 55): AFBC (1 << 55): This "non-category" for U-Interleaved (1 << 54): Whatever the next category is (3 << 54): Whatever comes after that (1 << 53): Maybe we'll get here someday ... I didn't want to explicitly reserve some high bits, because we've no idea how many to reserve. This way, we can assign exactly as many high bits as we need, when we need them. If any of the "modes" start encroaching towards the high bits, we'll have to make a decision at that point. Also, this is the only U-Interleaved format (that I know of), so it's not worth calling bit 55 "The U-Interleaved bit" because that would be a waste of space. It's more like the "misc" bit, but that's not a useful name to enshrine in UAPI. Note that isn't the same as the "not-AFBC bit", because we may well have something in the future which is neither AFBC nor "misc". We've been very careful in our code to enforce all undefined/unrecognised bits to be zero, to ensure that this works. >=20 > The other bit: Would be real good to define the format a bit more > precisely, including the layout within the tile. It's U-Interleaved, obviously ;-) -Brian >=20 > Also ofc needs acks from lima/panfrost people since I assume they'll > be using this, too. >=20 > Thanks, Daniel >=20 > > + > > +/* > > * Allwinner tiled modifier > > * > > * This tiling mode is implemented by the VPU found on all Allwinner p= latforms, > > -- > > 2.7.4 > > >=20 >=20 > --=20 > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch