Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp953579rwb; Thu, 11 Aug 2022 12:58:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR4AifAGnNXaQTP/Uw3f6EFJrSuQGrMdkir6vlqbiZbOiC5zzJjmpjsKtzyoSsKnbrUzDvPR X-Received: by 2002:a17:90b:1b08:b0:1f5:b65:9654 with SMTP id nu8-20020a17090b1b0800b001f50b659654mr577560pjb.77.1660247935094; Thu, 11 Aug 2022 12:58:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660247935; cv=none; d=google.com; s=arc-20160816; b=b4Pf5X78ALum3rXW0UgKxAI8Si0Nfw3w4puSfcJIJ2+FzyDomqhRZpLap3tU3DLiVv o5V23f7iBNKGjeCTkFC9uf8UM5ZtzAkuDKJUIKsM0C/uf/RIYdRytU24AQ0FfPLxpHfR lF7/jA6LbnRn6Ch4Hjl+IyBh34qS7LARYi0RH0WGw+GvzI3iJGb8EdVozLIjUNMjaQye tGz/0m0pzjCT0Z4M8qokxduD0q7k5duCWF306omVjCUz5/dEL3SB1FfxuBYTt1yLxGHF 2Cjfjs5MAE9pOz7YSvO7L6tf9ymBR26HA0vNV8v/TV9kB33LIDd5ZK9vVMxBDY1ZkeJ/ Vi0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=PiIxReYkxtBzv66jtBR4FROfX82syegstNTwPa+ySR0=; b=0apiS6Wo1RMc5lOFUG5gNe/AXjv/cGlkJxStn0VI6Fre+x4GVBrR+Sv0jba/I9Xy/c x1K+97y+Hol/ryKfi/54w9c7+skQdyAQJU3o+5vVn/NvUslR/TohdQwfrSs6iDdVc9VW WCV9/IHw61cuO4gerxAPWi0A71T7lH4ACVSp3MVsYO1I7SlxSY7tXsmA0puQce5+yCj5 /DmF31FdactGhDtOLigGU+K6qY/iow/8cMp1K8kMhUXn3m8jGnBcvT4oPRHycA8cOavJ 6owcpLTqiOekd1Asz6tGacdxPEanJ0rXWtFzUPXtQvT1j7hPKedHHee0zDrm80iIHPcM Aydw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa1 header.b=J4WnXA65; dkim=neutral (no key) header.i=@ravnborg.org header.b=lud6DSUj; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a63f512000000b00419facbc543si259203pgh.691.2022.08.11.12.58.41; Thu, 11 Aug 2022 12:58:55 -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=@ravnborg.org header.s=rsa1 header.b=J4WnXA65; dkim=neutral (no key) header.i=@ravnborg.org header.b=lud6DSUj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235054AbiHKTa0 (ORCPT + 99 others); Thu, 11 Aug 2022 15:30:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233439AbiHKTaY (ORCPT ); Thu, 11 Aug 2022 15:30:24 -0400 Received: from mailrelay4-1.pub.mailoutpod1-cph3.one.com (mailrelay4-1.pub.mailoutpod1-cph3.one.com [46.30.210.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDEAEB05 for ; Thu, 11 Aug 2022 12:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravnborg.org; s=rsa1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=PiIxReYkxtBzv66jtBR4FROfX82syegstNTwPa+ySR0=; b=J4WnXA650B9xrqJFOUNC99f85fvYDJAQp733iypsjAv6EqqJCkAK7OOrj2HmV44IcKdnV3v+7OM2Q VBI5UDXOx9WDYcqqlqUYamwCxt9veZ0xDP0M1tZNhzKtiTJk3LKqmoJvowc6jzgVcl1XbWbLHnWGaj prL9zk8v75TMw3wvqpIdOSgv8OKdHSseFmbRB9/hcaUaQsxV1ggShec0sc4PVydd3U/hZl73hVvHxr y/LkQkCaLbhyFGuCCwyE98HrhJ5vXM2lzB//fk+kRnBtI4dkJsF4/Qd47/hCwSJohfSbz0YxDuEoJO R1XE1Hodc/OUYnY5cMcYNsOsE7lki1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ravnborg.org; s=ed1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=PiIxReYkxtBzv66jtBR4FROfX82syegstNTwPa+ySR0=; b=lud6DSUj9xxo1AbujB4/Ho0gbti2rokDDTZkDXnKk5P5Gu4jnxPiTtmV5CE+z6T/r+e1iMKDNB/Wp EGowbZsDQ== X-HalOne-Cookie: 52a4d43754f5de879c648bea03fabce90926a481 X-HalOne-ID: 07f25d33-19ac-11ed-8245-d0431ea8bb10 Received: from mailproxy4.cst.dirpod4-cph3.one.com (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98]) by mailrelay4.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 07f25d33-19ac-11ed-8245-d0431ea8bb10; Thu, 11 Aug 2022 19:30:17 +0000 (UTC) Date: Thu, 11 Aug 2022 21:30:16 +0200 From: Sam Ravnborg To: Geert Uytterhoeven Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , DRI Development , Linux Fbdev development list , Linux/m68k , Linux Kernel Mailing List , Javier Martinez Canillas Subject: Re: [PATCH v3 01/10] drm/fourcc: Add drm_format_info_bpp() helper Message-ID: References: <1cae5ebc28513ec1c91c66b00647ce3ca23bfba7.1657294931.git.geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_PASS,SPF_NONE,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 Geert. > > > > > > Yeah I don't think we should describe these with bpp or cpp or anything > > > like that. bpp < 8 makes sense since that's how this has been done since > > > decades, but trying to extend these to funny new formats is a bad idea. > > > This is also why cpp and depth refuse to compute these (or at least > > > should). > > > > Daniel and I discussed this on irc. Let me try to recap here. > > Using the bits per pixel info from drm_format_info is something we shall > > try to avoid as this is often a sign of the wrong abstraction/design (my > > words based on the irc talk). > > So we shall limit the use of drm_format_info_bpp() to what we need now, > > thus blocky formats should not be supported - to try to avoid seeing > > this used more than necessary. > > > > Daniel suggested a rename to drm_format_info_legacy_bpp() to make it > > obvious that this is often/always the wrong solution. I did not jump on > > doing the rename as I do not know stuff good enough to tell people what > > to use when this is not the right solution. The rename is simple, it is > > the follow-up that keep me away. > > > > On top of this there is a few formats in drm_drourcc that has a depth > > field set which should be dropped. .depth is only for the few legacy > > formats where it is used today. > > > > We would also like to convert the fbdev helpers to drm_format_info, > > and doing so will likely teach us a bit more what we need and what we > > can drop. > > > > Geert - can you give drm_format_info_bpp() a spin so it is limited to > > the formats used now (not the blocky ones). > > You mean return 0 if char_per_block[] > 1? if char_per_block[] > 1 AND block_w[] > 0 AND block_h[] > 0 should be enough. > I'm not sure it's actually safe to do so (and make this change this late > in the development cycle), as this is used in drm_client_buffer_create(), > drm_client_buffer_addfb(), and drm_mode_getfb(). drm_client_buffer_create() and drm_client_buffer_addfb() both get their format from drm_mode_legacy_fb_format() which do not produce any blocky formats - so they are good. drm_mode_getfb() looks up a framebuffer originally created using one of the above (I think), so here it should also be fine. I do not see the need to push this to fixes, so it has a full cycle to mature if it causes issues. Sam