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 DDE0EC433F5 for ; Wed, 5 Oct 2022 10:51:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ABE0710E1AD; Wed, 5 Oct 2022 10:51:57 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id A543710E4B2; Wed, 5 Oct 2022 10:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664967112; x=1696503112; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=tzLz/h1cx3l0UqC+pOnjEYwI7zKEMRB48aEchfspRlE=; b=Rve5qgoRzpF2tPneBQYdIhW51rDn5ndHoe2P0pgPQRCqpxlq0WOUUg8g VK8g+lByKKgb+/PZLqLn9kmdTA28UV/tvSWhf1+kuZO+ICb9X0ANWy9yx 5cz+oGRu1/h5FngUCdJgui1C9vkwkfarSM5WSK0OGVSUt5/9U9H5m+lyN 5Nk/+o+JKx/I0i5tlupULuSkDdcqhfKMQ9rPDW9e9NUctvOQ7t08lN6bK WPMH4zaSABqmEo/mzCS3Av8FI40R/fjB+bvi8Jw1tTAc42CXsPdGAkspD qYQqyexeuOxgERmHs1IDpNrshU0750+fVwKxTbfBoy9xJOEsKDdQeGi6R A==; X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="286343559" X-IronPort-AV: E=Sophos;i="5.95,159,1661842800"; d="scan'208";a="286343559" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2022 03:51:51 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="655131149" X-IronPort-AV: E=Sophos;i="5.95,159,1661842800"; d="scan'208";a="655131149" Received: from gionescu-mobl2.ger.corp.intel.com (HELO localhost) ([10.252.39.173]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2022 03:51:48 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Date: Wed, 5 Oct 2022 13:51:42 +0300 Message-Id: X-Mailer: git-send-email 2.34.1 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 Subject: [Intel-gfx] [RFC 0/2] drm/connector: connector iterator with filtering 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: , Cc: jani.nikula@intel.com, Laurent Pinchart , Dave Airlie Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Currently i915 assumes all drm_connectors it encounters are embedded in intel_connectors that i915 allocated. The drm_writeback_connector forces a design where this is not the case; we can't provide our own connector, and writeback embeds the drm_connector it initializes itself. To use drm writeback, none of the i915 connector iteration could assume the drm connector is embedded in intel_connector. Checking this is tedious, and would require an intermediate step with drm_connector. Here's an idea I came up with; filtering at the drm connector iterator level with a caller supplied function. Not too much code, and could be used for other things as well. Mind you, we'd still much rather modify drm writeback to allow passing the connector i915 allocated, instead of the current midlayer design that forces drivers to a certain model. Working around this is a bunch of error prone and tedious code that we really could do without. BR, Jani. Cc: Arun R Murthy Cc: Dave Airlie Cc: Laurent Pinchart Cc: Suraj Kandpal Cc: Ville Syrjälä Jani Nikula (2): drm/connector: add connector list iteration with filtering drm/i915: iterate intel_connectors only drivers/gpu/drm/drm_connector.c | 57 +++++++++++++++---- drivers/gpu/drm/i915/display/intel_display.c | 3 +- .../drm/i915/display/intel_display_types.h | 7 +++ drivers/gpu/drm/i915/display/intel_dp.c | 6 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 3 +- drivers/gpu/drm/i915/display/intel_hdcp.c | 3 +- drivers/gpu/drm/i915/display/intel_hotplug.c | 12 ++-- .../drm/i915/display/intel_modeset_setup.c | 6 +- drivers/gpu/drm/i915/display/intel_opregion.c | 9 ++- include/drm/drm_connector.h | 9 +++ 10 files changed, 89 insertions(+), 26 deletions(-) -- 2.34.1