From patchwork Wed Dec 7 13:13:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wladimir J. van der Laan" X-Patchwork-Id: 9464455 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B20F760236 for ; Wed, 7 Dec 2016 13:13:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB6E4283E9 for ; Wed, 7 Dec 2016 13:13:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DEE0284D0; Wed, 7 Dec 2016 13:13:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3EFBF283E9 for ; Wed, 7 Dec 2016 13:13:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 927366E581; Wed, 7 Dec 2016 13:13:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 22A146E581 for ; Wed, 7 Dec 2016 13:13:41 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id g23so27830633wme.1 for ; Wed, 07 Dec 2016 05:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=bYS2K1lZ+l3I8B9fhdZVZ1KcceJ7veHvydBKj92HTnQ=; b=KkOKQY+d7XCZ4MqbetPXCKYrXZJ9WWwlH/t3d8Z3tpIdib4zQTCQNb0ZKtrVm6GrK1 UxiuzBXYC0ge2AMUTmmnJjcVHQk7Yhq4Ol+aEcwLVyAJznsMPFS7KJCMlxC/1TOl1MGF nir+Fesodc6hFfv2vDYRLmK2xqidp8Fyy5DItcE+xR+b6AYHgnvt9AQeeEmEXclukXR5 6fkSIcRE93XhQ0Kg0FfMLtlWEDfZ/BjN78GCWl1Yi1fy7ONrAHZqqHpdcWL4diop3B7A R3t67tygTotbAQZNzHgiHTumxQO2tJqFZ9+/bR96TFgxQaxPeCY2Jrv8MfjXUlLnQ0j/ Maiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=bYS2K1lZ+l3I8B9fhdZVZ1KcceJ7veHvydBKj92HTnQ=; b=FmXzw8+ufSdp+rgvU/9P4HY6c/qNeYa/baFmmFiZ3dJaC0yRaxOEX7Dxnyg79WJ0M1 mt5RVer1sHgbWp4EhzDAhKPNZuzLB44m3USoiSLZz/oSMqzB6nEhHBiZmRGc1+VajCI8 MDr7ZcTwO/j+QOYHhz0PbgRdWb53vsD8hMfEjTVQr5F3ym5IhFpHL+kFRxmKOGEYeowa npYeobOWu2MulxguyWaeZJw14nHiyx9IoIqPZw0lVfgCicWh69figl25MDKlJmje5mFm qYdfsbjwO9TL+1tKK/aQ826MTgASl9gqk1CV/g5FM9LTJxTfzVl+eV1Qm7LP11RdDGyE zNwg== X-Gm-Message-State: AKaTC01ZRozo3yEK4gYk3+7MjtPpVNHaq9qmqIrv5HQlkeWdDyeC4AuuLvP7Hsv3n4ovUg== X-Received: by 10.28.26.197 with SMTP id a188mr2502830wma.93.1481116419166; Wed, 07 Dec 2016 05:13:39 -0800 (PST) Received: from amethyst.visucore.com (d222031.upc-d.chello.nl. [213.46.222.31]) by smtp.gmail.com with ESMTPSA id d8sm9576013wmi.21.2016.12.07.05.13.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 05:13:38 -0800 (PST) Date: Wed, 7 Dec 2016 14:13:36 +0100 From: "Wladimir J. van der Laan" To: dri-devel@lists.freedesktop.org Subject: [PATCH] etnaviv: Cannot render to rb-swapped formats Message-ID: <20161207131336.GA4148@amethyst.visucore.com> MIME-Version: 1.0 Content-Disposition: inline Cc: Chris Healy X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Virus-Scanned: ClamAV using ClamSMTP Exposing rb swapped (or other swizzled) formats for rendering would involve swizzing in the pixel shader. This is not the case at the moment, so reject requests for creating such surfaces. (GPUs that need an extra resolve step anyway due to multiple pixel pipes, such as gc2000, might also do this swap in the resolve operation. But this would be tricky to keep track of) --- src/gallium/drivers/etnaviv/etnaviv_screen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index c3f270d..06327b6 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -464,8 +464,11 @@ etna_screen_is_format_supported(struct pipe_screen *pscreen, return FALSE; if (usage & PIPE_BIND_RENDER_TARGET) { - /* if render target, must be RS-supported format */ - if (translate_rs_format(format) != ETNA_NO_MATCH) { + /* If render target, must be RS-supported format that is not rb swapped. + * Exposing rb swapped (or other swizzled) formats for rendering would + * involve swizzing in the pixel shader. + */ + if (translate_rs_format(format) != ETNA_NO_MATCH && !translate_rs_format_rb_swap(format)) { /* Validate MSAA; number of samples must be allowed, and render target * must have MSAA'able format. */ if (sample_count > 1) {