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 22E17D65C70 for ; Wed, 17 Dec 2025 15:38:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD4EA10EBD7; Wed, 17 Dec 2025 15:38:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="bRV8RZdj"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 243C210EBD7 for ; Wed, 17 Dec 2025 15:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1765985907; x=1797521907; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=1t1w1365vjW/EDSVUIkpNG2jAvGYyUp/jH4h1+oT0xs=; b=bRV8RZdj4B3uPtH5UWw8SB2rLEenSDRK0p9pz117oVcsGPFqetOYLJCO RVZ5D2JF6GlUP6BzFelNBCJfvLrnmZ5BwbUcPEZqZR+yJEhdNcWRD+jEs FwDZtnTgLW+dFkFTQkhl0J6xurP4vtjTuz4U170Eqxf3pCmOX6Cwglf4U Z7TfnN6LBq6utwCY/X+PhMShMDQmOII+cI6LdkOeHDcbx1QikA3Ubw0bd RKiMdwvUzY9foKVdgGU5pl5rG5LtHKS/Mjfd1bvcnQ7ZbCCOmExkdL+zy 94Se3980XaIM6LO/PEbDYBXG9UMw4PIFyZ5lmGiTt1+W6focf/s2paYxI w==; X-CSE-ConnectionGUID: TnfaYIK1Q/GVDGJslqjRug== X-CSE-MsgGUID: bSeX1cM0QZ6O38L3vDbgDg== X-IronPort-AV: E=McAfee;i="6800,10657,11645"; a="71557016" X-IronPort-AV: E=Sophos;i="6.21,156,1763452800"; d="scan'208";a="71557016" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2025 07:38:26 -0800 X-CSE-ConnectionGUID: /oQXpSPDQbmXKUNIxKCu+A== X-CSE-MsgGUID: U6z/FzAaSbKXeRs9gFeahA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,156,1763452800"; d="scan'208";a="221718729" Received: from klitkey1-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.196]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2025 07:38:25 -0800 From: Ville Syrjala To: igt-dev@lists.freedesktop.org Subject: [PATCH i-g-t 07/11] lib/kms: Nuke pipe->plane_cursor Date: Wed, 17 Dec 2025 17:37:53 +0200 Message-ID: <20251217153758.9369-8-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251217153758.9369-1-ville.syrjala@linux.intel.com> References: <20251217153758.9369-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" From: Ville Syrjälä Get rid of of the redundant pipe->plane_cursor. It'll always be 'pipe->n_planes-1' after we've found the plane. And before we've found the plane we can just check for 'pipe->planes[pipe->n_planes-1].index < 0'. Signed-off-by: Ville Syrjälä --- lib/igt_kms.c | 6 ++---- lib/igt_kms.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 5bb8da1ec2c5..7ae166253a3f 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -3061,10 +3061,9 @@ static void igt_crtc_plane_init(igt_display_t *display, index = 0; pipe->num_primary_planes++; - } else if (type == DRM_PLANE_TYPE_CURSOR && pipe->plane_cursor == -1) { + } else if (type == DRM_PLANE_TYPE_CURSOR && pipe->planes[pipe->n_planes - 1].index < 0) { index = pipe->n_planes - 1; - pipe->plane_cursor = index; display->has_cursor_plane = true; } else { for (index = 1; index < pipe->n_planes; index++) { @@ -3113,7 +3112,6 @@ static void igt_crtc_init(igt_display_t *display, int j; pipe->display = display; - pipe->plane_cursor = -1; pipe->planes = NULL; pipe->num_primary_planes = 0; @@ -3566,7 +3564,7 @@ igt_plane_t *igt_pipe_get_plane_type(igt_crtc_t *pipe, int plane_type) switch(plane_type) { case DRM_PLANE_TYPE_CURSOR: - plane_idx = pipe->plane_cursor; + plane_idx = pipe->n_planes - 1; break; case DRM_PLANE_TYPE_PRIMARY: plane_idx = 0; diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 810eb7497834..4a814f0e9962 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -489,7 +489,6 @@ struct igt_crtc { int n_planes; int num_primary_planes; - int plane_cursor; igt_plane_t *planes; uint64_t changed; -- 2.51.2