From patchwork Sat May 20 02:57:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilia Mirkin X-Patchwork-Id: 9738453 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 CC8C8602DC for ; Sat, 20 May 2017 02:58:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD98528565 for ; Sat, 20 May 2017 02:58:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A093A2856B; Sat, 20 May 2017 02:58:10 +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_SIGNED, 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 3E9B128565 for ; Sat, 20 May 2017 02:58:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 79DDF6E19A; Sat, 20 May 2017 02:58:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF0D66E060; Sat, 20 May 2017 02:57:55 +0000 (UTC) Received: by mail-qk0-x241.google.com with SMTP id o85so12503163qkh.0; Fri, 19 May 2017 19:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=sZDGH/XoCHQF5/j7nDbKPMfu9b8IN8BNsflW5yNa5rM=; b=nng9Ato480HBghNI6B5gTm+uYLj9e6w+YZwMFrKJB/ROBNS9oScmNjK5Jv3Aco6e3u KxgMcSaW79KxTAa0wG707KPjj3bwKtA8TFYyLMUp265h/K/2kpYPD3GpkFbVvgvDa1zK G4B3za3lM0QZk0sVVvE7uWByMt17JlVtgIpvPyUnJPc/fiisD0IdKzGlfnBXQm+rE7Ni 8RWCelSQK7mvGoytliAOnfEpZGToGPMBFPc1QaRb3qVMD6m1RttngyTdbzPu2XzRf4FX zxzj7Zj0VQ/eRJfG5yTPanMkzAnTqonRd5pjHt/zjY0kjB3VuttavERSIh49FKHErwQh LSSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=sZDGH/XoCHQF5/j7nDbKPMfu9b8IN8BNsflW5yNa5rM=; b=kvYI3wSG2nBV5FBlEVlIY727xETn7Jg2MdYUhas9QoDBqx2VhJaMn7mp2sGblEfAZo N0hoFNqNXX0Djb13gt+kbXaAwuhRmagcP0mWHVNinq08asAta0yaL7oaSw5zN9E6WpOh /VZ1MGSkzSrRjpcWFEGRKVXNp/QeNmHXoMD1xnPdd7Fk3rI/imsHEAw50H3Ma9Xxj/Gs gQ4vUJR0n5yMGd0zECsj3RWoJS2lMJKaKuAv76qmknFP/oIEaMysOJAHTI56BL0DFuQU ftPImBniDmlIef5JMUOdDZ5qtejhDA7JB5EwgTRvJwNLmXXeSO6V79LuFdo0ZnlaGX5H Wuxg== X-Gm-Message-State: AODbwcBuojtYeDja4w3FK1zziSujn+9vsVffp0dMoSoYJt10jkE9i1Hl CF+ph9HTOOJeNNNa X-Received: by 10.55.23.84 with SMTP id i81mr11217956qkh.153.1495249074863; Fri, 19 May 2017 19:57:54 -0700 (PDT) Received: from athos.fios-router.home (pool-72-80-62-166.nycmny.fios.verizon.net. [72.80.62.166]) by smtp.gmail.com with ESMTPSA id t5sm421095qkd.4.2017.05.19.19.57.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 May 2017 19:57:54 -0700 (PDT) From: Ilia Mirkin To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [RFC PATCH 2/3] drm/nouveau/overlay: add NV21 support Date: Fri, 19 May 2017 22:57:48 -0400 Message-Id: <20170520025749.9291-3-imirkin@alum.mit.edu> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170520025749.9291-1-imirkin@alum.mit.edu> References: <20170520025749.9291-1-imirkin@alum.mit.edu> 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ilia Mirkin --- drivers/gpu/drm/nouveau/dispnv04/overlay.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c b/drivers/gpu/drm/nouveau/dispnv04/overlay.c index ee7df9ef2695..96354a5ff21c 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c +++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c @@ -63,6 +63,7 @@ static uint32_t formats[] = { DRM_FORMAT_YUYV, DRM_FORMAT_UYVY, DRM_FORMAT_NV12, + DRM_FORMAT_NV21, }; /* Sine can be approximated with @@ -177,16 +178,18 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, nvif_wr32(dev, NV_PVIDEO_POINT_OUT(flip), crtc_y << 16 | crtc_x); nvif_wr32(dev, NV_PVIDEO_SIZE_OUT(flip), crtc_h << 16 | crtc_w); - if (fb->format->format != DRM_FORMAT_UYVY) + if (fb->format->format == DRM_FORMAT_YUYV || + fb->format->format == DRM_FORMAT_NV12) format |= NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8; - if (fb->format->format == DRM_FORMAT_NV12) + if (fb->format->format == DRM_FORMAT_NV12 || + fb->format->format == DRM_FORMAT_NV21) format |= NV_PVIDEO_FORMAT_PLANAR; if (nv_plane->iturbt_709) format |= NV_PVIDEO_FORMAT_MATRIX_ITURBT709; if (nv_plane->colorkey & (1 << 24)) format |= NV_PVIDEO_FORMAT_DISPLAY_COLOR_KEY; - if (fb->format->format == DRM_FORMAT_NV12) { + if (format & NV_PVIDEO_FORMAT_PLANAR) { nvif_wr32(dev, NV_PVIDEO_UVPLANE_BASE(flip), 0); nvif_wr32(dev, NV_PVIDEO_UVPLANE_OFFSET_BUFF(flip), nv_fb->nvbo->bo.offset + fb->offsets[1]);