From patchwork Wed Sep 25 06:30:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Garg, Nemesa" X-Patchwork-Id: 13811639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB5A9CF9C6C for ; Wed, 25 Sep 2024 06:30:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6114F10E79C; Wed, 25 Sep 2024 06:30:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="eVSmEiYg"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id E425E10E792 for ; Wed, 25 Sep 2024 06:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727245816; x=1758781816; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8J8m+yU6VaYVJl6lXn2QAFjHFgLaSgPD4sqKdymvU4w=; b=eVSmEiYgColAY+TvPFjlXTVdnXePj/DyNBjdaa7eUa/Kzse7P2OQVrId n7lEMBhmsNABzJGypMY8TsLQGXEns1GFJGyZog6Zar2oKbHQ6wsRY1YGZ 3axbWhh/NhNmP7lkSLwrqgoETwTRMqQZAiqtugYu3egOBv+ODut5MWD2Z Sy/GLDDFZNptmBUs5Zz4y0ipenAywqr9xpqB+G5k1CzwPbNaRz7Ym1zFg v3BPAPJCio18WHE3gMRma/7MvLMTcsD3lmCeFv8/7wjCsQMAt7iiVK/aJ lmD4HLlIclXxjVyure9ncGMZZObUSxdGIzd7rmfOGfmhhKr6kHPpaZB69 Q==; X-CSE-ConnectionGUID: Ndmhhb5mTJ68oIZfsflfaw== X-CSE-MsgGUID: ab0VL5VSQwWLomXdOgfE+Q== X-IronPort-AV: E=McAfee;i="6700,10204,11205"; a="43794782" X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="43794782" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2024 23:30:16 -0700 X-CSE-ConnectionGUID: kXYgpybvRfCYUBqspOcRRQ== X-CSE-MsgGUID: qLpW2VsCRUKXdBibRLml7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="94989548" Received: from nemesa.iind.intel.com ([10.190.239.22]) by fmviesa002.fm.intel.com with ESMTP; 24 Sep 2024 23:30:14 -0700 From: Nemesa Garg To: intel-gfx@lists.freedesktop.org Cc: Nemesa Garg Subject: [PATCH 1/3] drm/i915/display: Modify panel_fitting code for joiner Date: Wed, 25 Sep 2024 12:00:30 +0530 Message-Id: <20240925063032.2311796-2-nemesa.garg@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240925063032.2311796-1-nemesa.garg@intel.com> References: <20240925063032.2311796-1-nemesa.garg@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Replace adjusted_mode with pipe_mode in pch_panel_fitting so as to that final pipe src width and height is used after joiner calculation. De-couple the current intel_panel_fitting function, one pre-ilk and one post-ilk, as post-ilk pch_panel_fitting is called from pipe_config. v4: Replace adjusted_mode with pipe_mode[Ville] Keep gmch panel fitting in same place[Ville] Signed-off-by: Nemesa Garg --- drivers/gpu/drm/i915/display/intel_panel.c | 52 +++++++++++----------- drivers/gpu/drm/i915/display/intel_panel.h | 8 +++- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 71454ddef20f..bd25c96f2e57 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.c +++ b/drivers/gpu/drm/i915/display/intel_panel.c @@ -387,15 +387,15 @@ void intel_panel_add_encoder_fixed_mode(struct intel_connector *connector, static int pch_panel_fitting(struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; + const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode; int pipe_src_w = drm_rect_width(&crtc_state->pipe_src); int pipe_src_h = drm_rect_height(&crtc_state->pipe_src); int x, y, width, height; /* Native modes don't need fitting */ - if (adjusted_mode->crtc_hdisplay == pipe_src_w && - adjusted_mode->crtc_vdisplay == pipe_src_h && + if (pipe_mode->crtc_hdisplay == pipe_src_w && + pipe_mode->crtc_vdisplay == pipe_src_h && crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420) return 0; @@ -403,45 +403,45 @@ static int pch_panel_fitting(struct intel_crtc_state *crtc_state, case DRM_MODE_SCALE_CENTER: width = pipe_src_w; height = pipe_src_h; - x = (adjusted_mode->crtc_hdisplay - width + 1)/2; - y = (adjusted_mode->crtc_vdisplay - height + 1)/2; + x = (pipe_mode->crtc_hdisplay - width + 1) / 2; + y = (pipe_mode->crtc_vdisplay - height + 1) / 2; break; case DRM_MODE_SCALE_ASPECT: /* Scale but preserve the aspect ratio */ { - u32 scaled_width = adjusted_mode->crtc_hdisplay * pipe_src_h; - u32 scaled_height = pipe_src_w * adjusted_mode->crtc_vdisplay; + u32 scaled_width = pipe_mode->crtc_hdisplay * pipe_src_h; + u32 scaled_height = pipe_src_w * pipe_mode->crtc_vdisplay; if (scaled_width > scaled_height) { /* pillar */ width = scaled_height / pipe_src_h; if (width & 1) width++; - x = (adjusted_mode->crtc_hdisplay - width + 1) / 2; + x = (pipe_mode->crtc_hdisplay - width + 1) / 2; y = 0; - height = adjusted_mode->crtc_vdisplay; + height = pipe_mode->crtc_vdisplay; } else if (scaled_width < scaled_height) { /* letter */ height = scaled_width / pipe_src_w; if (height & 1) height++; - y = (adjusted_mode->crtc_vdisplay - height + 1) / 2; + y = (pipe_mode->crtc_vdisplay - height + 1) / 2; x = 0; - width = adjusted_mode->crtc_hdisplay; + width = pipe_mode->crtc_hdisplay; } else { x = y = 0; - width = adjusted_mode->crtc_hdisplay; - height = adjusted_mode->crtc_vdisplay; + width = pipe_mode->crtc_hdisplay; + height = pipe_mode->crtc_vdisplay; } } break; case DRM_MODE_SCALE_NONE: - WARN_ON(adjusted_mode->crtc_hdisplay != pipe_src_w); - WARN_ON(adjusted_mode->crtc_vdisplay != pipe_src_h); + WARN_ON(pipe_mode->crtc_hdisplay != pipe_src_w); + WARN_ON(pipe_mode->crtc_vdisplay != pipe_src_h); fallthrough; case DRM_MODE_SCALE_FULLSCREEN: x = y = 0; - width = adjusted_mode->crtc_hdisplay; - height = adjusted_mode->crtc_vdisplay; + width = pipe_mode->crtc_hdisplay; + height = pipe_mode->crtc_vdisplay; break; default: @@ -666,16 +666,16 @@ static int gmch_panel_fitting(struct intel_crtc_state *crtc_state, return 0; } -int intel_panel_fitting(struct intel_crtc_state *crtc_state, - const struct drm_connector_state *conn_state) +int intel_gch_panel_fitting(struct intel_crtc_state *crtc_state, + const struct drm_connector_state *conn_state) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_i915_private *i915 = to_i915(crtc->base.dev); + return gmch_panel_fitting(crtc_state, conn_state); +} - if (HAS_GMCH(i915)) - return gmch_panel_fitting(crtc_state, conn_state); - else - return pch_panel_fitting(crtc_state, conn_state); +int intel_pch_panel_fitting(struct intel_crtc_state *crtc_state, + const struct drm_connector_state *conn_state) +{ + return pch_panel_fitting(crtc_state, conn_state); } enum drm_connector_status diff --git a/drivers/gpu/drm/i915/display/intel_panel.h b/drivers/gpu/drm/i915/display/intel_panel.h index 15a8c897b33f..0f678cd72403 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.h +++ b/drivers/gpu/drm/i915/display/intel_panel.h @@ -42,8 +42,12 @@ enum drrs_type intel_panel_drrs_type(struct intel_connector *connector); enum drm_mode_status intel_panel_mode_valid(struct intel_connector *connector, const struct drm_display_mode *mode); -int intel_panel_fitting(struct intel_crtc_state *crtc_state, - const struct drm_connector_state *conn_state); +int intel_gch_panel_fitting(struct intel_crtc_state *crtc_state, + const struct drm_connector_state *conn_state); + +int intel_pch_panel_fitting(struct intel_crtc_state *crtc_state, + const struct drm_connector_state *conn_state); + int intel_panel_compute_config(struct intel_connector *connector, struct drm_display_mode *adjusted_mode); void intel_panel_add_edid_fixed_modes(struct intel_connector *connector, From patchwork Wed Sep 25 06:30:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Garg, Nemesa" X-Patchwork-Id: 13811640 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8D80CF9C71 for ; Wed, 25 Sep 2024 06:30:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6594B10E792; Wed, 25 Sep 2024 06:30:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Z4e90TN3"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5D5F10E792 for ; Wed, 25 Sep 2024 06:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727245818; x=1758781818; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ohSiYzvsntjivbQrHRrUNZK9rT6G+Jx1crGrsATO2Yw=; b=Z4e90TN3gZfWg5i3dvnw2EIgdb/lEuziac6oJCADc88ILJxox500Dqh9 fF6A0hKaPaStmQxPz/kFPmzKq4w60yk32LRZglmQCi/ouBAHW9pmqJqRK LKnejaEzrj9C7VhaaAZZSNgJ0XLfj/RXCju14jl9THjyF8RJ2JUyQ7N+3 35UtYkVC1dfop3GdF5TF+Qp3ZNXGBfx5YEMhgxIq4xfYa6Ev0f5c1G2YW I2vSNOsU2MhUa07neoeOTrkuCjzWxLtpddv3CZJkjK6A9ysl50X4k1iQy nvd+WhivorZ2P2BZL5spf/lAea5MKwSxFAIeVAojIh3pQNPvAD5WrG4rX Q==; X-CSE-ConnectionGUID: x09XDZ5xT9S5LtOyeHYxCw== X-CSE-MsgGUID: U/fj2QTfQOyy59MQMOVjyA== X-IronPort-AV: E=McAfee;i="6700,10204,11205"; a="43794791" X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="43794791" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2024 23:30:18 -0700 X-CSE-ConnectionGUID: JBqT0YB5RGKEO0EoZWWVYg== X-CSE-MsgGUID: 1KQ6sYLzRAuJhTt1YXoCJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="94989565" Received: from nemesa.iind.intel.com ([10.190.239.22]) by fmviesa002.fm.intel.com with ESMTP; 24 Sep 2024 23:30:16 -0700 From: Nemesa Garg To: intel-gfx@lists.freedesktop.org Cc: Nemesa Garg Subject: [PATCH 2/3] drm/i915/display: Add gmch_panel_fitting in all encoders Date: Wed, 25 Sep 2024 12:00:31 +0530 Message-Id: <20240925063032.2311796-3-nemesa.garg@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240925063032.2311796-1-nemesa.garg@intel.com> References: <20240925063032.2311796-1-nemesa.garg@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" For all encoders add gmch_panel_fitting and remove pch_panel_fitting as it will be called from pipe_config after joiner calculation is done. Signed-off-by: Nemesa Garg --- drivers/gpu/drm/i915/display/icl_dsi.c | 8 +++++--- drivers/gpu/drm/i915/display/intel_dp.c | 5 ++--- drivers/gpu/drm/i915/display/intel_hdmi.c | 4 ++-- drivers/gpu/drm/i915/display/intel_lvds.c | 8 +++++--- drivers/gpu/drm/i915/display/vlv_dsi.c | 8 +++++--- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 293efc1f841d..cfbfbc815d8c 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -1641,9 +1641,11 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, if (ret) return ret; - ret = intel_panel_fitting(pipe_config, conn_state); - if (ret) - return ret; + if (HAS_GMCH(i915)) { + ret = intel_gch_panel_fitting(pipe_config, conn_state); + if (ret) + return ret; + } adjusted_mode->flags = 0; diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index a1fcedfd404b..480cb8dc2948 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -3049,9 +3049,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, if (ret) return ret; - if ((intel_dp_is_edp(intel_dp) && fixed_mode) || - pipe_config->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) { - ret = intel_panel_fitting(pipe_config, conn_state); + if (HAS_GMCH(dev_priv)) { + ret = intel_gch_panel_fitting(pipe_config, conn_state); if (ret) return ret; } diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index cd9ee171e0df..90b4664f66f8 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2345,8 +2345,8 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder, return ret; } - if (intel_hdmi_is_ycbcr420(pipe_config)) { - ret = intel_panel_fitting(pipe_config, conn_state); + if (HAS_GMCH(display)) { + ret = intel_gch_panel_fitting(pipe_config, conn_state); if (ret) return ret; } diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index fb4ed9f7855b..c28979b4ac15 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -463,9 +463,11 @@ static int intel_lvds_compute_config(struct intel_encoder *encoder, if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) return -EINVAL; - ret = intel_panel_fitting(crtc_state, conn_state); - if (ret) - return ret; + if (HAS_GMCH(i915)) { + ret = intel_gch_panel_fitting(crtc_state, conn_state); + if (ret) + return ret; + } /* * XXX: It would be nice to support lower refresh rates on the diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index d21f3fb39706..753a883c30c2 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -282,9 +282,11 @@ static int intel_dsi_compute_config(struct intel_encoder *encoder, if (ret) return ret; - ret = intel_panel_fitting(pipe_config, conn_state); - if (ret) - return ret; + if (HAS_GMCH(dev_priv)) { + ret = intel_gch_panel_fitting(pipe_config, conn_state); + if (ret) + return ret; + } if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) return -EINVAL; From patchwork Wed Sep 25 06:30:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Garg, Nemesa" X-Patchwork-Id: 13811641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF511CF9C73 for ; Wed, 25 Sep 2024 06:30:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 68CFD10E7A1; Wed, 25 Sep 2024 06:30:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="RuLE1wB4"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id E797910E79D for ; Wed, 25 Sep 2024 06:30:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727245820; x=1758781820; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5/WG8fI496GtD7SJZ3zfQgrPy1e2X/Of19n6sa6NW0w=; b=RuLE1wB4GngtDFrR23Sh0PC442cYY8MQjG41pvU+a5BzTh5bu6Q/7JTB uDgezxZ8z53x+NVAbr6rWaUXQmvbs0g4lwomRt7wCDgCW5irNVHBm8JgE uEt7P/7HzceIzNOyFaKnv7NIS3NpVW4YsxsFpHz8RtJ6kd4iXFrS0Yi26 RhK46eRNPqWqT2muaWPWEQDI24eOGPCgRLo8oZePl4gXeZkudJjh/TBQI 4TUhdWHWrt4BJAiyu0Krcisti/j1CT7kcj2tlDVelfkUFcXg9AZws4BLL GgikbEl7cWH5TYJp1cq0ztOGeYU5eAtifycQYKL4OborFMec1eMDkN8Hs A==; X-CSE-ConnectionGUID: 0TbJOopdTEuWB4cAq3IyzA== X-CSE-MsgGUID: /WM8eB7WTaa0HZOgAcCR6w== X-IronPort-AV: E=McAfee;i="6700,10204,11205"; a="43794800" X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="43794800" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2024 23:30:20 -0700 X-CSE-ConnectionGUID: 1gjyiHjBSD+XeYWWLXsGJg== X-CSE-MsgGUID: 1rCtvQDMR1aJtxMPWEsJrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="94989576" Received: from nemesa.iind.intel.com ([10.190.239.22]) by fmviesa002.fm.intel.com with ESMTP; 24 Sep 2024 23:30:19 -0700 From: Nemesa Garg To: intel-gfx@lists.freedesktop.org Cc: Nemesa Garg Subject: [PATCH v4 3/3] drm/i915/display: Call panel_fitting from pipe_config Date: Wed, 25 Sep 2024 12:00:32 +0530 Message-Id: <20240925063032.2311796-4-nemesa.garg@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240925063032.2311796-1-nemesa.garg@intel.com> References: <20240925063032.2311796-1-nemesa.garg@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" In panel fitter/pipe scaler scenario the pch_pfit configuration currently takes place before accounting for pipe_src width for joiner. This causes issue when pch_pfit and joiner get enabled together. Call panel_fitting from pipe_config once pipe src is computed. v4: Remove need_joiner flag [Ville] Signed-off-by: Nemesa Garg --- drivers/gpu/drm/i915/display/intel_display.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index b4ef4d59da1a..0148939caaaa 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -4653,6 +4653,8 @@ intel_modeset_pipe_config(struct intel_atomic_state *state, intel_atomic_get_new_crtc_state(state, crtc); struct drm_connector *connector; struct drm_connector_state *connector_state; + const struct drm_display_mode *fixed_mode; + struct intel_dp *intel_dp; int pipe_src_w, pipe_src_h; int base_bpp, ret, i; @@ -4774,6 +4776,24 @@ intel_modeset_pipe_config(struct intel_atomic_state *state, return ret; } + for_each_new_connector_in_state(&state->base, connector, + connector_state, i) { + struct intel_encoder *encoder = + to_intel_encoder(connector_state->best_encoder); + + if (connector_state->crtc != &crtc->base) + continue; + + intel_dp = enc_to_intel_dp(encoder); + + if (!intel_dp) + continue; + + if ((intel_dp_is_edp(intel_dp) && fixed_mode) || + crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) + return intel_pch_panel_fitting(crtc_state, connector_state); + } + /* Dithering seems to not pass-through bits correctly when it should, so * only enable it on 6bpc panels and when its not a compliance * test requesting 6bpc video pattern.