From patchwork Tue Aug 20 09:07:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13769626 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2CE9BC3DA4A for ; Tue, 20 Aug 2024 09:09:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A764210E536; Tue, 20 Aug 2024 09:09:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="L13rjhoZ"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id D682A10E536 for ; Tue, 20 Aug 2024 09:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724144964; 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: content-transfer-encoding:content-transfer-encoding; bh=lRgqOXyBX9RvDpJkM6Di0st4mw6ssMTucyaILMSw5CA=; b=L13rjhoZA58ZNhkC385lU8+JQYDyU7dDpGDQibL0ztMqmyfnqV2u12zM4k2kZIVZA+8rOw OJ9S51PY6gSNKNXHMHdPMZmfe4p1NBGOZmqqLFstQ+vrxBVpoge+hCIudUjp7k3pMcn7Mi 9ZvgNFWSUoP69eZ17F/HScfvY9ZCMMk= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-vIZOpLqvOAm3QggsuBIv9g-1; Tue, 20 Aug 2024 05:09:20 -0400 X-MC-Unique: vIZOpLqvOAm3QggsuBIv9g-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 20D691954B1B; Tue, 20 Aug 2024 09:09:19 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.193.88]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 675391955F45; Tue, 20 Aug 2024 09:09:14 +0000 (UTC) From: Jocelyn Falempe To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Daniel Vetter , dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev Cc: Jocelyn Falempe , Javier Martinez Canillas Subject: [PATCH v2 1/2] drm/virtio: Use XRGB8888 also for big endian systems Date: Tue, 20 Aug 2024 11:07:40 +0200 Message-ID: <20240820090908.151042-1-jfalempe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Mesa doesn't support BGRX8888, that means most wayland compositors don't work on big endian guests. Signed-off-by: Jocelyn Falempe Acked-by: Javier Martinez Canillas --- drivers/gpu/drm/virtio/virtgpu_display.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_gem.c | 2 +- drivers/gpu/drm/virtio/virtgpu_plane.c | 10 ++-------- 3 files changed, 5 insertions(+), 11 deletions(-) base-commit: 8befe8fa5a4e4b30787b17e078d9d7b5cb92ea19 diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 64baf2f22d9f0..3572a53ea2061 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -299,8 +299,8 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev, struct virtio_gpu_framebuffer *virtio_gpu_fb; int ret; - if (mode_cmd->pixel_format != DRM_FORMAT_HOST_XRGB8888 && - mode_cmd->pixel_format != DRM_FORMAT_HOST_ARGB8888) + if (mode_cmd->pixel_format != DRM_FORMAT_XRGB8888 && + mode_cmd->pixel_format != DRM_FORMAT_ARGB8888) return ERR_PTR(-ENOENT); /* lookup object associated with res handle */ diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 7db48d17ee3a8..601e06962530f 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -75,7 +75,7 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, args->size = pitch * args->height; args->size = ALIGN(args->size, PAGE_SIZE); - params.format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB8888); + params.format = virtio_gpu_translate_format(DRM_FORMAT_XRGB8888); params.width = args->width; params.height = args->height; params.size = args->size; diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index a72a2dbda031c..860b5757ec3fc 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -30,11 +30,11 @@ #include "virtgpu_drv.h" static const uint32_t virtio_gpu_formats[] = { - DRM_FORMAT_HOST_XRGB8888, + DRM_FORMAT_XRGB8888, }; static const uint32_t virtio_gpu_cursor_formats[] = { - DRM_FORMAT_HOST_ARGB8888, + DRM_FORMAT_ARGB8888, }; uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc) @@ -48,12 +48,6 @@ uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc) case DRM_FORMAT_ARGB8888: format = VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM; break; - case DRM_FORMAT_BGRX8888: - format = VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM; - break; - case DRM_FORMAT_BGRA8888: - format = VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM; - break; default: /* * This should not happen, we handle everything listed