Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1744375lqo; Sun, 12 May 2024 17:13:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeX2UT5LYqll5TzKq9rmGny+IaoqaJ9R41uVkOj/xJRyn2A20OOFYG4Lmn7XJWJp5hN8a5F6tg8G0mLnQndtHYOZwdlp6A8iEis0uB4A== X-Google-Smtp-Source: AGHT+IEFHQk3zv6HfZdBI1475GuF0Z1K08FRPHEfP1nhPYK0+Qc3P3yO987V/Arm0+PXzCOuCD0r X-Received: by 2002:a05:6a21:32a9:b0:1ae:4c81:87d with SMTP id adf61e73a8af0-1afde0d4d0fmr7988318637.14.1715559233329; Sun, 12 May 2024 17:13:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715559233; cv=pass; d=google.com; s=arc-20160816; b=QcO9srFvjarNjN95eGII3Naevf++5pka9jPBKP2ojRyjDni1cxD8E2FjUtj+30IRIe vJHx7Gxs3OegiuM/Ft0XdLdmo/xYgDwyOJ7+EOCe0eJ6kvZlCXpUtJG2TXKZCR/VkUQP 8tfEeauuJZY8fyTzSts+GbvWsi+3DCrB+F9ZgSnUG8Tl65jMbC2jGsUkusrC/g6jtaGI 54I/PXKKS/duH4BVEvL5uWR48p11LS5mmB/buvhiQ1oX/NxDfyMfc19Ft/yrGkqA+K1q aTZ6Tk2EnQMs/+lI4L5YnzBBkSqL8c9zNvcJz8x7nDXrSLiM5DY8S/aiSTNxK3MotYR2 Kr8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=XJY1www0AxrnCm+16UJMjjPkfXJT0ujI5r+bchZsf1M=; fh=NuGnp3yIX/lIaCrd+NjTmDZChMAGT+57wDSfP0XHwKE=; b=X8BebM+LxJqP86FcTKroD0+WYp/RUFBn/mQqLWvrl88HGNQbEYiqJ4S5jJmR/ke781 Fnfs/HO+hiaWe76qbD2PUH7S2pNeBwBJ91D6AaNL+C0UpLgjM0WaO0PN4XG2MqzChI2T WvtP0skFnkXS7MOftV8Ge8RbwjhrUMEuiUPXnHFAuP5lqgQRDXFbwqsrVxYGQFv1w2/q ndwwr9qxj1TEgGebPcV5WzAq8aLYpZIBRYslIB9ZCZcEAeojjtmezmSOMFcNUeX8PUfq xJdy8MA/erqPronPpia7+QxWtUri4ba9eAgRpGq/gS7R9sjPALYTXSe8h1137XYJNX/N rLiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="VPW/nhbX"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-177060-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177060-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628a5c323si10323269a91.42.2024.05.12.17.13.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 17:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177060-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="VPW/nhbX"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-177060-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177060-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AACDA281335 for ; Mon, 13 May 2024 00:13:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6717D80B; Mon, 13 May 2024 00:13:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="VPW/nhbX" Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0590917E for ; Mon, 13 May 2024 00:13:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715559225; cv=none; b=bJaaL96uhacPP1rYQcZAhGpNoW2UoiEUg0emPLc1+i2CYlv8TX5AFmQnJsv/hEeleFJWGt+/114MgeftNKeoqOZqGoCtSnBMabr5t+UJSC9p4ScTkNh9OYNBgdMAG+L0P5e6uEEAXyrrWaP6GlaDQf50Yg1oX/HplItjMWkg4TQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715559225; c=relaxed/simple; bh=yBPp7S7yh6RT5LOFnsV1L929izvs98i6FjXz8rjKkyM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=rjyVKCTPbVqfoJTRYPFjUmZ2jtKuvUwDNqvn1aOienLLgkq0mM6197uVaFnPKH2ICzXP15nOx3a/X3JofZ3W/PzjWW1yL1psCdxBYLti+dMgd8O0/tHD5/71OYtRugDB5XkuK/OpZo+ERAuTYUOGdtDk3Dib4wOIfr9VE+BZ5B4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=VPW/nhbX; arc=none smtp.client-ip=91.218.175.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715559220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=XJY1www0AxrnCm+16UJMjjPkfXJT0ujI5r+bchZsf1M=; b=VPW/nhbX72YlHmO0ZRVZ7TioRdby1C6sMHM3Dd5CcuZx+1gprGSzmW39+/6rq6Rrfnepu9 PCv42jxiQkKTrvR9JHjuHyaNhUU1IrsxpDSlFJfMmwyqY2676uGt/j/o/+8bIPSh5IG7HU 1ecOjPtsP3k4Dfn8XoJOxtUh3bQeNCU= From: Sui Jingfeng To: Maxime Ripard , Thomas Zimmermann Cc: Sui Jingfeng , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sui Jingfeng Subject: [PATCH 0/3] drm/loongson: Introduce component framework support Date: Mon, 13 May 2024 08:12:40 +0800 Message-Id: <20240513001243.1739336-1-sui.jingfeng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Introduce the component framework to bind childs and siblings, for better modularity and paper over the deferral probe problems if it need to attach exterinal module someday. Hardware units come with PCI(e) are actually all ready to drive, but there has some board specific modules will return -EPROBE_DEFER. We need all other submodules ready to attach before we can register the drm device to userspace. The idea is to devide the exterinal module dependent part and exterinal module independent part clearly, for example, the display controller and the builtin GPIO-I2C just belong to exterinal module independent part. While the output is belong to exterinal module dependent part. Also for better reflecting the hardware, we intend to abstract the output ports as child devices. The output ports may consists of encoder phy and level shift, while the GPU and VPU are standalone siblings. As those units are relative separate hardware units from display controller itself. By design, the display controller PCI(e) is selected as the component master, gpio-i2c go with master. The manually created virtual child device are functional as agents for the master, it could return the -EPROBE_DEFER back to the component core. This allows the master don't have to tear down everything, the majority setups work can be preserved. The potential cyclic dependency problem can be solved with such framework. Sui Jingfeng (3): drm/loongson: Add helpers for creating subdevice drm/loongson: Introduce component framework support drm/loongson: Refactor lsdc device initialize and the output port drivers/gpu/drm/loongson/Makefile | 1 + drivers/gpu/drm/loongson/loongson_device.c | 42 ++++ drivers/gpu/drm/loongson/loongson_module.c | 17 +- drivers/gpu/drm/loongson/loongson_module.h | 1 + drivers/gpu/drm/loongson/lsdc_drv.c | 208 +++++++++++------- drivers/gpu/drm/loongson/lsdc_drv.h | 34 +-- drivers/gpu/drm/loongson/lsdc_output.c | 183 +++++++++++++++ drivers/gpu/drm/loongson/lsdc_output.h | 38 +++- drivers/gpu/drm/loongson/lsdc_output_7a1000.c | 3 +- drivers/gpu/drm/loongson/lsdc_output_7a2000.c | 15 +- 10 files changed, 422 insertions(+), 120 deletions(-) create mode 100644 drivers/gpu/drm/loongson/lsdc_output.c -- 2.34.1