From mboxrd@z Thu Jan 1 00:00:00 1970 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 023ADC61DD6 for ; Wed, 2 Sep 2026 08:17:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A86310F06A; Wed, 2 Sep 2026 08:17:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="cRnjkuLf"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id C38E910F065; Wed, 2 Sep 2026 08:17:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788337076; x=1819873076; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=20l32YHH/KvRVlRigzAmg/6mIQbbLbTFDugBTkHKXz8=; b=cRnjkuLfbEDNLSJzu5FEVcHY+zsCZEte7kjJFvAtJMo0hf16X5eSVmSn OPisANxKdRkhc1VHwiQOeYiiDU0UL2wxZBq8yE1Df6Ekp/zBrjPbtYdRm JCHZzwMEEZKR8vIJBQ5MkXozNb6BlSG9sfr9vwIDDKjAQxoFGbyksPbwU xxZxOfVnfoDK3YLBR27oRt8OFGKP6dSfnb3P1PGcuwORE1/g18C9AuAT/ rjh+3yGbuRfIr3IAwRb/uUhztMsaZefHtpbf4i8Jw6ELy/qeX5RW2LkfE C3WiwTH6CgR56B/ljUS5lwjIKoDeU4qsR0UbNDKRY/QPThpI/5QiOB9+w A==; X-CSE-ConnectionGUID: 1NRdkkPnQjKk2pipTloiLg== X-CSE-MsgGUID: cMj1+2KETOCcf3duDkzbfw== X-IronPort-AV: E=McAfee;i="6800,10657,11893"; a="100299814" X-IronPort-AV: E=Sophos;i="6.25,257,1779174000"; d="scan'208";a="100299814" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2026 01:17:55 -0700 X-CSE-ConnectionGUID: zbCxcEjUQj+Hwb3jtHIafg== X-CSE-MsgGUID: jTWNxNfRR4e90CKeLk5CZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,257,1779174000"; d="scan'208";a="263193668" Received: from dut-2a59.iind.intel.com ([10.190.239.113]) by fmviesa009.fm.intel.com with ESMTP; 02 Sep 2026 01:17:54 -0700 From: Chaitanya Kumar Borah To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [CI 3/9] drm/i915/display: simplify glk_plane_color_ctl_input_csc Date: Wed, 2 Sep 2026 13:24:11 +0530 Message-ID: <20260902075417.656673-4-chaitanya.kumar.borah@intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260902075417.656673-1-chaitanya.kumar.borah@intel.com> References: <20260902075417.656673-1-chaitanya.kumar.borah@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Add early return for non-YUV formats and hoist the duplicated color_range check out of the if/else branches. No functional change. Signed-off-by: Chaitanya Kumar Borah Reviewed-by: Uma Shankar --- drivers/gpu/drm/i915/display/skl_universal_plane.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index f6db8ee691a2..973062dfc558 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -1252,7 +1252,10 @@ static u32 glk_plane_color_ctl_input_csc(const struct intel_plane_state *plane_s struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); u32 ctl = 0; - if (fb->format->is_yuv && !icl_is_hdr_plane(display, plane->id)) { + if (!fb->format->is_yuv) + return 0; + + if (!icl_is_hdr_plane(display, plane->id)) { switch (plane_state->hw.color_encoding) { case DRM_COLOR_YCBCR_BT709: ctl |= PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709; @@ -1263,14 +1266,13 @@ static u32 glk_plane_color_ctl_input_csc(const struct intel_plane_state *plane_s default: ctl |= PLANE_COLOR_CSC_MODE_YUV601_TO_RGB601; } - if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE) - ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE; - } else if (fb->format->is_yuv) { + } else { ctl |= PLANE_COLOR_INPUT_CSC_ENABLE; - if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE) - ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE; } + if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE) + ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE; + return ctl; } -- 2.50.1