From patchwork Wed Sep 30 07:05:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1374151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C1S2R5zZqz9sTq; Wed, 30 Sep 2020 17:05:35 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1kNWBA-00038J-62; Wed, 30 Sep 2020 07:05:32 +0000 Received: from mail-pf1-f195.google.com ([209.85.210.195]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kNWB8-00037W-Jd for kernel-team@lists.ubuntu.com; Wed, 30 Sep 2020 07:05:30 +0000 Received: by mail-pf1-f195.google.com with SMTP id w7so541096pfi.4 for ; Wed, 30 Sep 2020 00:05:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xFIA7wF8/OSFFVLP/JZLEPe7D9sPo13jGEpsvnKGL48=; b=PdtjlsAG7YvfP+m8pLiF/bImRaDK4ZsTBW3T37RvIXzirxHDOzQot0NIbNIRM/NsX7 AmSdL9W+I0w4p2+lYPzPDvb/iLRNspiWZ+cj3Ag99Mmk9/ehVky2aF9EdOhKn3rGUxAC 6r1FGOtEhFJkfoUwapm7fATLU1K8EbDchqkthON2eTyLDBEZZn5VI+sOPNNJzn2gzJC3 izGAnz+xRZa3rbawFUhZdZgRMjufcaacUM9Znk6kwKMuyMjcX6MqHUfgoU02DeIJIfUT B+M7/ah0tRL9kWk3adec+tvu9tewOKoLoHvtVK+SELrfDBSE2ca3cSnTkYGr6XUxxqOx DfJg== X-Gm-Message-State: AOAM533fRzu5ZLpy9MjOPPh2/fGE7iqDkUqUFXVc56qCo/rvfTn52Dut MJgqeCFT383oYLAk2cJu06JxtfV7rkm3LQ== X-Google-Smtp-Source: ABdhPJw1KKujXmRL6O1o/1ttKBxLXdu0Zrs8ZUMmBXZgfnDqxjw/oKqvp7wYk7s1LKKy6rZB/UEQuA== X-Received: by 2002:a63:b64a:: with SMTP id v10mr1063507pgt.192.1601449528279; Wed, 30 Sep 2020 00:05:28 -0700 (PDT) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id y4sm1038453pgl.67.2020.09.30.00.05.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 00:05:27 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 1/2][SRU][OEM-5.6] UBUNTU: SAUCE: drm/i915/psr: allow overriding PSR disable param by quirk Date: Wed, 30 Sep 2020 15:05:13 +0800 Message-Id: <20200930070515.711477-4-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200930070515.711477-1-vicamo.yang@canonical.com> References: <20200930070515.711477-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.195; envelope-from=vicamo@gmail.com; helo=mail-pf1-f195.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1897501 HP ZBook Studio G7 equips an INX FHD N156HCG-GQ1 panel that renders corrupted screen when PSR is disabled. This patch allows overriding the default disabled i915_modparams.enable_psr since LP: #1849947 to use chip default when a EDID match is on. Signed-off-by: You-Sheng Yang --- drivers/gpu/drm/i915/display/intel_psr.c | 8 ++++++++ include/drm/drm_dp_helper.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 8f50b249175d..a6a16ad026c8 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1423,6 +1423,14 @@ void intel_psr_init(struct drm_i915_private *dev_priv) */ dev_priv->hsw_psr_mmio_adjust = _SRD_CTL_EDP - _HSW_EDP_PSR_BASE; + /* + * PSR was disabled by module parameters but the underlying panel is + * depending on it, so use per-chip default to probe that automatically. + */ + if ((dev_priv->psr.dp->edid_quirks & BIT(DP_QUIRK_FORCE_PSR_CHIP_DEFAULT)) && + i915_modparams.enable_psr == 0) + i915_modparams.enable_psr = -1; + if (i915_modparams.enable_psr == -1) if (INTEL_GEN(dev_priv) < 9 || !dev_priv->vbt.psr.enable) i915_modparams.enable_psr = 0; diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 98e7fd15cc15..de4d8cdad02c 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1548,6 +1548,14 @@ enum drm_dp_quirk { * capabilities advertised. */ DP_QUIRK_FORCE_DPCD_BACKLIGHT, + /** + * @DP_QUIRK_FORCE_PSR_CHIP_DEFAULT + * + * PSR was disabled by default in Ubuntu 5.0 kernels and on, but some + * platforms might be depending on them. If so, use per-chip default to + * probe that automatically. + */ + DP_QUIRK_FORCE_PSR_CHIP_DEFAULT, }; /**