Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8536787rwb; Thu, 24 Nov 2022 00:28:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf5J/+Baa5n/uJz75RwatedlNG7rN+747nPOKfZxwbSRpCCJug9g5W1Js02Qf6V8sVFx7ZB+ X-Received: by 2002:a17:907:2a10:b0:7a7:9b01:2a6c with SMTP id fd16-20020a1709072a1000b007a79b012a6cmr26838559ejc.153.1669278512232; Thu, 24 Nov 2022 00:28:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669278512; cv=none; d=google.com; s=arc-20160816; b=IOfyKF/Bv9+3AtEzku2TJSxKNzkQUqfQ6FwdGTb4NFDDFJmwarqKouxFjc/o6oXzsa OKPE+ZMErKm2ZIJ+Bz33iYvJHgJv8fcKrwQUB+j+GF24+kwVis2jqgtcOAvU41JpBaNJ 3kO0rAT63dUnp/9Ukcoay/WGTQmuYvLCHl6c92A3nJnB51ndIwqE2mpBahqh4WgAsAnb HcR7sAsLl4xNh8ElM2zxrTwQ7lYZ250J51JKE2EDw9A+IOq93+5ojm7h7qdkdmdto1ex oES6NU6JH2a7b1EDtCZuTW9Em85gJyOl1Nly8QyxyRy/wefJKjxxvteIwglTskV3Uct/ 7+hA== 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; bh=bTI6njseVR+SJYrnLmEsAgR/iOZqJjjFs8hwOBW7QoE=; b=grDLTWHQom4r7THbOMzW/sqv5z0g5r/HVq3lRDyWXc48VsDuUjQ+P8VsfzMH3PuKgV n/AbFXTYm3tsGXMtQqZUEPCUK3S3OOXkg7mcBuoKH53Bf56qFbeiFYBxTgZdf/ZP5Hhq OTEQ8s06J7DwfwOl1/JGF9crjDBz2kEzFGyqMfY03R21zP/ITB8ANl8JFWkitkPBEKJT FNJZfy6PhMawNiuOTGZqBQlF6CUx892oqj1EGOeSIxK4PSr1zqnVulqpeDHBGTU4QCAa vMw1ZFxH1Obt4uNVuTRgrvht6kJs/sMN3syReL0h4cy1AqOZunD9vgMhjA66frVHuxSZ TFew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dBJnxJdj; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg2-20020a1709072cc200b00780837381d8si315039ejc.591.2022.11.24.00.28.10; Thu, 24 Nov 2022 00:28:32 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=dBJnxJdj; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229525AbiKXHa5 (ORCPT + 88 others); Thu, 24 Nov 2022 02:30:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiKXHax (ORCPT ); Thu, 24 Nov 2022 02:30:53 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA5B27C036 for ; Wed, 23 Nov 2022 23:29:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669274995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bTI6njseVR+SJYrnLmEsAgR/iOZqJjjFs8hwOBW7QoE=; b=dBJnxJdjiw0YdDMxV3fZi/sZT55m6LVF68ol7VQsjezUShhmMDas0J0kKXbOQprKGW52Ka GxshCbC1fQUlFb2PaaPTWblYqKPqDyPnH+3jbWTaFVoA8/Sgzi2O1jMxB6Yhp47w56hKhj htvRztODLJm47YjVWW3AYAh7fQQzkIw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-270-gMryAAnqPKGMWM7c5YgH5w-1; Thu, 24 Nov 2022 02:29:52 -0500 X-MC-Unique: gMryAAnqPKGMWM7c5YgH5w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9512585A59D; Thu, 24 Nov 2022 07:29:51 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A0FD4EA61; Thu, 24 Nov 2022 07:29:50 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B8424180039D; Thu, 24 Nov 2022 07:51:48 +0100 (CET) Date: Thu, 24 Nov 2022 07:51:48 +0100 From: Gerd Hoffmann To: Geert Uytterhoeven Cc: Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH resend v2] drm/fourcc: Add missing big-endian XRGB1555 and RGB565 formats Message-ID: <20221124065148.7v4m3qli2k74mic6@sirius.home.kraxel.org> References: <3ee1f8144feb96c28742b22384189f1f83bcfc1a.1669221671.git.geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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, > > > +#ifdef __BIG_ENDIAN > > > > Why do we need the #ifdef here? Iirc some hw has big endian flags in the > > scanout registers, so could supprt this unconditionally if there's no > > #ifdef around the format defines. Some drivers might then also want a > > DRM_FORMAT_FOO_BE define to simplify tables and stuff, but that's more a > > bikeshed. > > "Limit this to big-endian platforms, as there is currently no need > to support these formats on little-endian platforms." > > Will anyone make use of this? In theory, all of the 16-bpp formats > can have a big-endian counterpart. Highly unlikely. Dealing with 16-bpp formats in non-native byte order is a PITA because it isn't enough to simply adjust the masks and shifts to pick the correct bits and be done with it. The qemu stdvga happens to have a register to switch framebuffer byteorder (so both x64 and ppc are happy), and the bochs drm driver actually supports that no matter what the cpu byte order is, but it supports only DRM_FORMAT_XRGB8888 + DRM_FORMAT_BGRX8888. Supporting 16 bpp in the driver wouldn't be that much of a problem, but processing the framebuffer on the host side when emulating a big endian guest on a little endian host is painful. I think I can't ask pixman to do a conversation from DRM_FORMAT_RGB565 | DRM_FORMAT_BIG_ENDIAN to DRM_FORMAT_XRGB8888 on a little endian machine. take care, Gerd