Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1795927rdb; Sun, 19 Nov 2023 10:33:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcOCzd5IVJbK+l9QvhQG7GJs1irrw/AVNgAaAuhsTxJ4b84WmwQ6w5KbWy7qBCH4O7OEwh X-Received: by 2002:a05:6a20:7f98:b0:187:7b78:ecd7 with SMTP id d24-20020a056a207f9800b001877b78ecd7mr4349564pzj.53.1700418802826; Sun, 19 Nov 2023 10:33:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700418802; cv=none; d=google.com; s=arc-20160816; b=nByTAgdMCJ5FNO5unp2rkgyBvHA+d1dETcsY9kKGjckXjsUnNIk8AnLZo466PC7w0g la6bOAEmR4PSGp6xIdziNQ65chRQzP74slZXsNJ68jcRpGeUx90RGrsUsoADqRlQpSUd xPTkZDNoiT+ltmxQspOo7Hv1+lKPvq1Rxb7k3DJYl9gwvTk0WlAfZ5aTGKACo6y7Dq09 ovyKB8kTKDztZ7kSjLjUXqtaYf4SUCmtmukOMt3uuqVTPQ6aXqOS6kC4JKd1jgLqNvdn j/I3mbi4OinFsHmoaGsur9tAp9xsqjFjA61mo/SdxjKEOb6toL7PTJVop4SQjIjZtidM TZKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=RdW8qdn5gAdRjHtcDSygEKY+bMk79mmUfX6/JL3l5Uo=; fh=4C+S55wl41cKWcwzwENt1f+66yHuxkJUF2Lrb9VW0aU=; b=0HleRyNJDQ9OJsgHA+Se9CUY8UIMpkFK2LX2ByhEO7CcDrENYNRDmW9mpVN5KnxI4/ wgUG5DGE8iVayhkE+q3iGnX/8jMJFePWGR5hEmbdNxg2/FWEtfKUGbA19cirFvbPdwdZ lOxQo4LPa31NFJg34ZGjTs3Zl4h/u70vtijlSN2KoAzPS9lj3xBcbSv66jp8vf9HG2jw 7DRQSmvtPQn0S5mjYJluD7XG8WFJC5MCliM9nInMvYuU7i52yuSjbRg0zYDPnxEdva/Y xVTmuXfULsswSaZCFKofUOGTH6mkVrZ8d16DYEFgORYkDZiHSpQB5sU8Z3WRgyo6Okto Wy2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bx15-20020a056a02050f00b005b91536981csi7577106pgb.11.2023.11.19.10.33.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 10:33:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 97CA380A73EB; Sun, 19 Nov 2023 10:33:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbjKSSdU convert rfc822-to-8bit (ORCPT + 99 others); Sun, 19 Nov 2023 13:33:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjKSSdT (ORCPT ); Sun, 19 Nov 2023 13:33:19 -0500 Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E427103 for ; Sun, 19 Nov 2023 10:33:15 -0800 (PST) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-5a7b3d33663so41329117b3.3 for ; Sun, 19 Nov 2023 10:33:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700418794; x=1701023594; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Sgxs19g9ItwMLXCwSaFSmWY+3YFGqlRFFiHfPCTZTc=; b=D3csgkL70qT/IhxcFPUTFE3j9jiZXrYAibcDfE9eb4pdZvmIrfi9WK7KA6zUDFFrs9 ceiRmjFcqUzvxEhcrmZk8nOhAMwYSE0LfsQgE3CqGx6La4BWIAl8EMlqRejwiN2Gi9IE edvYxknILWdZP5CXECQiNEzPzUILL8ELXLoAxxi53fHIWB64H2ncSkoYqYhhZvo28CXn NTMxdPdc3OzedjIW44l+OxknWZYSgh7ANbr5x2zqPviZ7koXTfcxSeUsfDTbWmHfMTmT 0pegjd/j6haH89k0g+zgbo9jxtKxF988/jfmiYhSWcCi+JFEThJPyFB24/tN9ZZpWB4H fHew== X-Gm-Message-State: AOJu0YzPiCYprzwyZlMj/IDlybjfIOt8z/2Fbo+OzVDd/ds11P4jiqPs 3xFgSXRNm1EgbxgAbQaJp9MpzEn1HgK+XQ== X-Received: by 2002:a0d:f701:0:b0:5c8:c9af:3e01 with SMTP id h1-20020a0df701000000b005c8c9af3e01mr5914778ywf.42.1700418794081; Sun, 19 Nov 2023 10:33:14 -0800 (PST) Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com. [209.85.128.169]) by smtp.gmail.com with ESMTPSA id c15-20020a81b54f000000b005ca607eb16fsm193934ywk.44.2023.11.19.10.33.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Nov 2023 10:33:13 -0800 (PST) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-5c9d850a0dbso6297027b3.2 for ; Sun, 19 Nov 2023 10:33:13 -0800 (PST) X-Received: by 2002:a81:cb01:0:b0:5ca:9ca4:f412 with SMTP id q1-20020a81cb01000000b005ca9ca4f412mr97776ywi.43.1700418793512; Sun, 19 Nov 2023 10:33:13 -0800 (PST) MIME-Version: 1.0 References: <47a81d2e0e47b1715718779b6978a8b595cc7c5d.1700140609.git.geert@linux-m68k.org> <77c6gkquzq4sdtmrlko3lkxvcnipm2zfjem3kvhgslcellkefh@man7pbbzud47> In-Reply-To: From: Geert Uytterhoeven Date: Sun, 19 Nov 2023 19:33:01 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] drm/virtio: Add suppport for non-native buffer formats To: Christian Zigotzky Cc: Gerd Hoffmann , David Airlie , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Thomas Zimmermann , Laurent Vivier , Javier Martinez Canillas , Hamza Mahfooz , linux-m68k@lists.linux-m68k.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, "R.T.Dickinson" , mad skateman , Darren Stevens , Christian Zigotzky Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 19 Nov 2023 10:33:21 -0800 (PST) Hi Christian, On Sun, Nov 19, 2023 at 5:28 PM Christian Zigotzky wrote: > On 16 November 2023 at 03:44 pm, Gerd Hoffmann wrote: > > On Thu, Nov 16, 2023 at 02:16:54PM +0100, Geert Uytterhoeven wrote: > >> When using virtgpu on a big-endian machine, e.g. powerpc QEMU: > >> > >> virtio-pci 0000:00:02.0: [drm] *ERROR* fbdev: Failed to setup generic emulation (ret=-2) > >> > >> or m68k/virt: > >> > >> virtio-mmio virtio-mmio.125: [drm] *ERROR* fbdev: Failed to setup generic emulation (ret=-2) > >> > >> and the graphical display fails to come up. > >> > >> Before, the call to drm_mode_addfb() caused a translation from a fourcc > >> format (XR24) to a bpp/depth pair (32/24) to a potentially different fourcc > >> format (BX24 on big-endian), due to the quirk processing in > >> drm_driver_legacy_fb_format(). After, the original fourcc format (XR24) > >> is passed unmodified. > >> > >> However, the virtgpu DRM driver supports only a single format for its > >> main plane: DRM_FORMAT_HOST_XRGB8888, which is XR24 on little-endian, > >> and BX24 on big-endian. I.e. on big-endian, virtgpu does not support > >> XR24, which is the default DRM format, and must be supported by all > >> drivers. Before, this was reported, but didn't lead to a failure: > >> > >> virtio-mmio virtio-mmio.125: [drm] bpp/depth value of 32/24 not supported > >> virtio-mmio virtio-mmio.125: [drm] No compatible format found > >> > >> As the core virtgpu driver and device support both XR24 and BX24 on both > >> little-endian and big-endian just fine, fix this extending the list of > >> supported formats for main plane and cursor plane to XR24/BX24 resp. > >> AR24/BA24. > >> > >> Fixes: 6ae2ff23aa43a0c4 ("drm/client: Convert drm_client_buffer_addfb() to drm_mode_addfb2()") > >> Reported-by: Christian Zigotzky > >> Closes: https://lore.kernel.org/r/c47fba21-3ae9-4021-9f4a-09c2670ebdbc@xenosoft.de > >> Suggested-by: Gerd Hoffmann > >> Signed-off-by: Geert Uytterhoeven > > Reviewed-by: Gerd Hoffmann > > The new patch works but I don't see the virtio-mouse-pci pointer > anymore. I see the pointer with -device usb-tablet. Please check the > second patch. I will use the first patch for the RC2 of kernel 6.7. That's probably partially explained by commit 99748ab64fcc8578 ("drm: virtio: fix virtio_gpu_cursor_formats"), which forced BA24 for the cursor plane on big-endian, but unfortunately linked thread doesn't contain the full picture. Where is the default cursor format defined? I see virtio_gpu_mode_dumb_create() still defaults to DRM_FORMAT_HOST_XRGB8888. However, that can't be the cause, as the cursor formats require an alpha channel. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds