From patchwork Sun Aug 6 02:25:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilia Mirkin X-Patchwork-Id: 9883477 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 6C19760360 for ; Sun, 6 Aug 2017 02:26:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C6D82872D for ; Sun, 6 Aug 2017 02:26:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5163128731; Sun, 6 Aug 2017 02:26:01 +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 0252828753 for ; Sun, 6 Aug 2017 02:25:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DD046E21B; Sun, 6 Aug 2017 02:25:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 063986E1B5; Sun, 6 Aug 2017 02:25:13 +0000 (UTC) Received: by mail-qt0-x243.google.com with SMTP id i19so5016850qte.1; Sat, 05 Aug 2017 19:25:12 -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=H4Y6J5I4o5dU/vdjqC8RiyHXvFSIX7HdwKF5wNiIgS4=; b=UqeEjNb/cdFsdO4LbpbGHbmiHdHi+VeLQK8PEpMVHL7W3u28ihbqfueQD4tELaq+wF 4PE3mvg3mKP2ZN5g1RrDfJY1kBMt5kUTt2NK4EcPAVL/vdHxcOoJHp04lNa12BZ9gxWj r5WEwQcFnkGi/AiBvtu5s4tEljYm+yybofW7/HkIy3DGEij+DI3b/7KS4OQhXuoLfUAp Lf7KeCZY2RErWYsdIeap1UQ8iw+yw/ZkH1+PeLKcbAiumLkcM4VDhBde5+/QWy9KrVdj nLUdNfCD3621OFhY60aZM1WKl72EKkwpcuryMYpZNuPFmZ5mt+YLvAG6m6gdn2W/qPC+ nBAw== 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=H4Y6J5I4o5dU/vdjqC8RiyHXvFSIX7HdwKF5wNiIgS4=; b=JHKYBARYouvO5Nb8IwUEe0lLzWzvmWy+ulSvrMf0i3uMhGpwngxL4KIxATfvXZVnbw +OHYbBaf9zIlJsjiH92fOxvkNFNvWJzgAi4/JouozEm905p7lbfMcgBZL7tiKQHSjIDy eYsWtJ50orI7JDFEiUzgW8LA9flQOXDntorBDSw+XWkZoVZACBolWX1ip+M+UlEGGhN8 MomzuOmI0gD3PZOofqf6j8rRW6CH8euZ3KLFgNM1O8b2R2VsRe5e7qYUt7+2zM+WzmE4 A6q2Q1pGxfkBYL/BlODZSYvYNwzNGQJAYwtv3eglezogi2A+uIwC+3lBsPHhJTWtcWDW Z7Tg== X-Gm-Message-State: AHYfb5gv5fBiQCqKqpnZAX1vQpSGMP6WYXkQJdf7K5H+GtQb7CK0yTsZ nY275Vkoc70vpRS9 X-Received: by 10.237.34.180 with SMTP id p49mr9680649qtc.163.1501986312202; Sat, 05 Aug 2017 19:25:12 -0700 (PDT) Received: from athos.fios-router.home (pool-100-2-1-206.nycmny.fios.verizon.net. [100.2.1.206]) by smtp.gmail.com with ESMTPSA id h47sm3633391qte.67.2017.08.05.19.25.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 05 Aug 2017 19:25:11 -0700 (PDT) From: Ilia Mirkin To: Ben Skeggs , nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm/nouveau/overlay: add NV21 support Date: Sat, 5 Aug 2017 22:25:04 -0400 Message-Id: <20170806022505.3763-4-imirkin@alum.mit.edu> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170806022505.3763-1-imirkin@alum.mit.edu> References: <20170806022505.3763-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 5bd63c2f14a6..c8c2333f24ee 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 @@ -159,16 +160,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]);