From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751262AbdEBR5a (ORCPT ); Tue, 2 May 2017 13:57:30 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:33564 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbdEBR51 (ORCPT ); Tue, 2 May 2017 13:57:27 -0400 MIME-Version: 1.0 In-Reply-To: <1493737591.8581.126.camel@redhat.com> References: <20170502133404.15354-1-kraxel@redhat.com> <20170502133404.15354-2-kraxel@redhat.com> <20170502172724.31188e2d@eldfell> <1493737591.8581.126.camel@redhat.com> From: Ilia Mirkin Date: Tue, 2 May 2017 13:57:26 -0400 X-Google-Sender-Auth: gMCWmpgRXpl1DUzhzsbiqedbfqo Message-ID: Subject: Re: [PATCH 1/3] drm: fourcc byteorder: drop DRM_FORMAT_BIG_ENDIAN To: Gerd Hoffmann Cc: Pekka Paalanen , Emil Velikov , ML dri-devel , Jani Nikula , David Airlie , =?UTF-8?Q?Michel_D=C3=A4nzer?= , open list , amd-gfx mailing list , Sean Paul , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Alex Deucher , Daniel Vetter Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 2, 2017 at 11:06 AM, Gerd Hoffmann wrote: > Radeon and nvidia (nv40) cards where mentioned. I'll try to summarize > (feel free to correct me if I'm wrong). > > nvidia has support for 8 bit-per-color formats only on bigendian hosts. > Not sure whenever this is a driver or hardware limitation. Let me just summarize the NVIDIA situation. First off, pre-nv50 and nv50+ are entirely different and unrelated beasts. The (pre-nv50) hardware has (a few) "big endian mode" bits. Those bits are kind of unrelated to each other and control their own "domains". One of the domains is reading of the scanout fb. So as a result, the hardware can scan out XRGB8888, RGB565, and XRGB1555 stored in either little or big endian packings, irrespective of the "mode" that other parts of the hardware are in. However there's the delicate little question of the GPU *generating* the data. These older GPUs don't have quite the format flexibility offered by newer hw. So only XRGB8888 is supported, packed in whatever "mode" the whole PGRAPH unit is in. (I say this because things seem to work when rendering using the XRGB8888 format while scanning out with the BE flag set.) There are no APIs for controlling the endianness of each engine in nouveau, so it ends up being in "big endian" mode on BE hosts, so the GPU can only render to big-endian-packed framebuffers. None of this applies to nv50+ hw. (Although it might in broad strokes.) Currently the driver is exposing XRGB8888 and ARGB8888 formats as that's what drm_crtc_init does for it. However the ARGB8888 format doesn't work (and shouldn't be exposed, the alpha is meaningless on a single-plane setup), and the XRGB8888 format is assumed to be packed in cpu host endian (and the "BE" bit is set accordingly). Hope this helps! -ilia