Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1428934AbdDYJxM (ORCPT ); Tue, 25 Apr 2017 05:53:12 -0400 Received: from mga04.intel.com ([192.55.52.120]:56983 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1428678AbdDYJxF (ORCPT ); Tue, 25 Apr 2017 05:53:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,249,1488873600"; d="scan'208";a="1139852889" Date: Tue, 25 Apr 2017 12:52:59 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Michel =?iso-8859-1?Q?D=E4nzer?= Cc: Gerd Hoffmann , Daniel Vetter , amd-gfx@lists.freedesktop.org, open list , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 3/6] drm: fourcc byteorder: add bigendian support to drm_mode_legacy_fb_format Message-ID: <20170425095259.GK30290@intel.com> References: <20170424062532.26722-1-kraxel@redhat.com> <20170424062532.26722-4-kraxel@redhat.com> <3b872a56-80b5-0c44-712f-a9517489eb24@daenzer.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3b872a56-80b5-0c44-712f-a9517489eb24@daenzer.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 983 Lines: 31 On Tue, Apr 25, 2017 at 12:18:52PM +0900, Michel D?nzer wrote: > On 24/04/17 03:25 PM, Gerd Hoffmann wrote: > > Return correct fourcc codes on bigendian. Drivers must be adapted to > > this change. > > > > Signed-off-by: Gerd Hoffmann > > Just to reiterate, this won't work for the radeon driver, which programs > the GPU to use (effectively, per the current definition that these are > little endian GPU formats) DRM_FORMAT_XRGB8888 with pre-R600 and > DRM_FORMAT_BGRX8888 with >= R600. > > > > +#ifdef __BIG_ENDIAN > > + switch (bpp) { > > + case 8: > > + fmt = DRM_FORMAT_C8; > > + break; > > + case 24: > > + fmt = DRM_FORMAT_BGR888; > > + break; > > BTW, endianness as a concept cannot apply to 8 or 24 bpp formats. To 8bpp no, but it can easily apply to 24bpp. Same was as it applies to 16bpp. Neither matches the word size of the CPU or anything like that but still the bytes have to stored in memory in some order. -- Ville Syrj?l? Intel OTC