Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763265AbdDSMe4 convert rfc822-to-8bit (ORCPT ); Wed, 19 Apr 2017 08:34:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39924 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762952AbdDSMew (ORCPT ); Wed, 19 Apr 2017 08:34:52 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1638A6330E Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1638A6330E Message-ID: <1492605289.6853.32.camel@redhat.com> Subject: Re: [RfC PATCH] drm: fourcc byteorder: brings header file comments in line with reality. From: Gerd Hoffmann To: Pekka Paalanen Cc: Michel =?ISO-8859-1?Q?D=E4nzer?= , Daniel Vetter , amd-gfx@lists.freedesktop.org, "dri-devel@lists.freedesktop.org" , open list Date: Wed, 19 Apr 2017 14:34:49 +0200 In-Reply-To: <20170419100956.78e4a7ab@eldfell> References: <20170410101202.19229-1-kraxel@redhat.com> <20170410161214.305f5daf@eldfell> <1491833847.30990.77.camel@redhat.com> <20170410180941.43922e25@eldfell> <20170411103101.0497fe08@eldfell> <1492510440.27392.27.camel@redhat.com> <4230c093-6a8a-76d6-dce8-f9b2300fa70f@daenzer.net> <20170419100956.78e4a7ab@eldfell> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 19 Apr 2017 12:34:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2117 Lines: 50 Hi, > > >> BTW, this supports Gerd's patch, since the KMS fbdev emulation code uses > > >> e.g. DRM_FORMAT_XRGB8888 for depth/bpp 24/32, and the fbdev API uses > > >> native endian packed colour values. > > > > > > Same is true for DRM_IOCTL_MODE_ADDFB, with depth/bpp 24/32 you'll get > > > DRM_FORMAT_XRGB8888 (only DRM_IOCTL_MODE_ADDFB2 allows userspace specify > > > fourcc formats directly). > > > > Right, and since all major Xorg drivers use DRM_IOCTL_MODE_ADDFB, > > they're effectively using DRM_FORMAT_XRGB8888 as native endianness as well. > > I sincerely hope this doesn't actually force us into a place where we > have XRGB8888 (and ARGB8888?) as native-endian, but the other format > codes - since being used explicitly - must be kept as little-endian > because they were used like that honouring the documentation we have > atm. My expectation is that the other formats are (almost) unused in practice. cairo for example supports XRGB8888 + ARGB8888 (native endian) only from all depth/bpp 24/32 formats. IIRC there was a brief discussion how we should handle endianness in qemu stdvga / bochsdrm.ko before we've added the new (virtual) hardware register to switch endianness. The idea to simply run with fixed endianness (framebuffer is always little endian) was shot down quickly with the argument that this isn't going to fly due to lack of support for XRGB8888 in non-native byte order in the whole graphics stack. > It's starting to resemble the wl_shm format codes problem we have > on Wayland for BE. > > Has this now turned into a question of what the kernel drivers do > with the DRM pixel format codes? > > Hmm, I suppose that has been the question all along... Yep, basically. I have the impression that drivers are either consider those formats being native endian or simply don't care because they are never used in systems with bigendian (-capable) cpus. Anyone aware of anything else? Guess I'll go prepare a new version of the patch, declaring all rgb formats as native endian and putting a bunch of points from this thread into the commit message. cheers, Gerd