From patchwork Thu Feb 28 21:09:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10833729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8885A1399 for ; Thu, 28 Feb 2019 21:09:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76B1A2ED5A for ; Thu, 28 Feb 2019 21:09:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 696252F198; Thu, 28 Feb 2019 21:09:46 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 F0B512ED5A for ; Thu, 28 Feb 2019 21:09:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3EF56E236; Thu, 28 Feb 2019 21:09:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by gabe.freedesktop.org (Postfix) with ESMTPS id AAF0A6E236 for ; Thu, 28 Feb 2019 21:09:41 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id p25so25321501qtb.3 for ; Thu, 28 Feb 2019 13:09:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A2PwK7Et86uajyvJOlBchYugJFYpUQtwy2KBEWBw0rY=; b=oDAwcIVxF0UjaXImJ5/FmuBARBgvnBZFqWlJ+UxJdEUMEDG++FG9qXqyJPl4+FwpcB 4ld/ZdKiKlbDy98qty4Oa5MSWzTHrh5YMW+6q+2WL4bhj4kYD8EC0ckbr2OiCJywzyoW m67nzs/18VXop7OUNzODiBKR7e/7lr8VOf5EkZuAaE9BBt2BFOV7j7EFiPYT0KQ1I8Hw zi5RkF9AzLLj/NOJ45demMzxF69vcAWiwC3nDDZ+2bBT2TRyfxO60JRVwja/KPrlgRKu vhWBDEaTP3hgt3ib2G960UgdMnOnnioGhzEHWHylMywEhHDw/k5LYe+xyxXtpWGzyQyB pBbQ== X-Gm-Message-State: APjAAAXM8TOjmDQt85LDaA4zci6MUu0zJkiTZp+27AmqW5fLQ6wYCFn7 j0AdzjPQ2odv6Y0WUMTc16CO5EoPS2Y= X-Google-Smtp-Source: APXvYqwX5z0gveSENGJ3+cLne785i+pIFJT2FDPFwmvsgxzRt+6ndWx3dm9/TgmuiIrAzZtUSj6vsA== X-Received: by 2002:a0c:94f4:: with SMTP id k49mr1023074qvk.33.1551388180633; Thu, 28 Feb 2019 13:09:40 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id 70sm23271846qkb.39.2019.02.28.13.09.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 13:09:40 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH 0/5] drm: Add PSR helpers Date: Thu, 28 Feb 2019 16:09:29 -0500 Message-Id: <20190228210939.83386-1-sean@poorly.run> X-Mailer: git-send-email 2.21.0.rc2.261.ga7da99ff1b-goog MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A2PwK7Et86uajyvJOlBchYugJFYpUQtwy2KBEWBw0rY=; b=RZ3Fdm3bRqbT/iZCSgjXWD9Ai+xefNsYLI/Gfwv+II0gi4EkRBjrDm8yqySq0h8RYj wVzJPgFBA5ugEuKPLZuPMB9KZbpWiBy24u8mE+x9aCXQotmXVxl+TSvGXJtlYMs2IZPa VGZJDxJ7oSFc7Th9BpOY1BLaSfSyY7fv28Bbham26Lzi+42ZFURroLjFpLkWys7dfqk9 MP/kWLywWvlnRZvazvAn7CMseukEBsZc7NXMfe/5lO3UTzwQHszt2UrnT1kwUdPMkfAE /J2pWR3jcWiePfdfpNr2+2RHxjEqEFpMZQJEOXA3H8cbAP4Xtk3SF/1POfDoK1ciCJ6h trDA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul Hey all, Here's a set to add some helpers for drivers looking to implement PSR. I've converted rockchip as a proof of concept, and will likely do the work for msm dsi sometime in the coming months. PTAL, Sean Sean Paul (5): drm: Add helpers to kick off PSR enable/disable drm/rockchip: Check for fast link training before enabling psr drm/rockchip: Use the helpers for PSR drm/rockchip: Don't fully disable vop on PSR drm/rockchip: Use drm_atomic_helper_commit_tail_rpm Documentation/gpu/drm-kms-helpers.rst | 9 + drivers/gpu/drm/Makefile | 2 +- .../drm/bridge/analogix/analogix_dp_core.c | 206 +++++++---- .../drm/bridge/analogix/analogix_dp_core.h | 1 - drivers/gpu/drm/drm_atomic_helper.c | 34 ++ drivers/gpu/drm/drm_atomic_uapi.c | 5 + drivers/gpu/drm/drm_fb_helper.c | 9 + drivers/gpu/drm/drm_framebuffer.c | 18 + drivers/gpu/drm/drm_psr_helper.c | 343 ++++++++++++++++++ drivers/gpu/drm/rockchip/Makefile | 3 +- .../gpu/drm/rockchip/analogix_dp-rockchip.c | 70 ++-- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 12 +- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 37 +- drivers/gpu/drm/rockchip/rockchip_drm_psr.c | 290 --------------- drivers/gpu/drm/rockchip/rockchip_drm_psr.h | 30 -- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 59 ++- include/drm/bridge/analogix_dp.h | 4 +- include/drm/drm_connector.h | 22 ++ include/drm/drm_crtc.h | 11 + include/drm/drm_mode_config.h | 6 + include/drm/drm_psr_helper.h | 24 ++ 21 files changed, 699 insertions(+), 496 deletions(-) create mode 100644 drivers/gpu/drm/drm_psr_helper.c delete mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_psr.c delete mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_psr.h create mode 100644 include/drm/drm_psr_helper.h