From patchwork Mon Feb 12 13:13:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 20245 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2421219dyd; Mon, 12 Feb 2024 05:19:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUProu6akSuirQ3moOkusuYqg+O9N6UNONIoK8YPCvooZyHG7dz9ulrrVzLdufXUXPyidHOVH7TFOW03lciToT9F9entg== X-Google-Smtp-Source: AGHT+IHXeWbqGDCmyesOom+VyE87kkqCM16Xn0xOvEkqyZHqmgFLP9XbsBS+hBtlZY601Zj6EhK0 X-Received: by 2002:a17:906:ece8:b0:a38:1673:682a with SMTP id qt8-20020a170906ece800b00a381673682amr4975731ejb.32.1707743999228; Mon, 12 Feb 2024 05:19:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707743999; cv=pass; d=google.com; s=arc-20160816; b=irG3E9hPAOq8UFeJLdXBOnv6GgQzSUMfgq7G1NqaMuXO1gnfCdoX+0bmZ8QmJTtOa0 YO6Z4wRh90FTY0DAAvTPjPLUbTSSJwh9f2k1heSYcsumzTFEMWuK97APFfCxjqVsptYM G9Zv/UR29W7sg9FC07g4cbTUJ4f4bdqsG7aESXbaoEZ5HnaYUUD+SKzO0l/ugpfg3W62 aFWKPXdpKs/1U6BYPiCmIvGwmVmGCa+T1/Lf2G26XcYL11dvYlx/WmIQHLDn9SlpIgr9 q11YNL2jV+AMw37QkBVqmKxFxqY9QnkDAO2er+iR99UpyHDWDuq1ub/S7J0AyLFC54DP 3pyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:dkim-signature; bh=kvuLvApdM/ZlGaK4NZuFt8gRWwgyTlGJWJvpEXVTb1w=; fh=yTTseZN9R5V2IfDdzwrzSQN2xrPSZx/l8fanyZbwbe8=; b=PFye2kLaKd3jeMVDYLhn39nWjiI+bga70vgDY1ViQDKtqlF03HKaR/rtSqICnoidf1 AoXSBPo/C9egVOc5nw62A2e8ZefiRjxwbtR67Cj7DMd65m2fTSsWiSSxZBVu0ZH8W6Rp 0Wrazl7eXEQi3cFJtcQpnQoVIXgX2fFRBAjzRplF5BqNuQK1Un6rAYUDh+VXYrfgJA1t shj+sjpIcDsfzEce11GaXDrgANl0R/K4SpRHXUWXAQ9WPz7/pVBk8zB+c53KGItgQz02 lGlUcx+QcjUsroIsb3mwM/mlqoWxoZToTqEARCL695Nzxqf/SKlmUof4YCazF080Mv6Y vx8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qrqViZLi; arc=pass (i=1 spf=pass spfdomain=flex--panikiel.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-61632-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61632-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCVqt+iPpm7h/lrksRdp+c3EoQUjR3Wfy0hxPfmF9WKtHYeAUtc5yezGUELSJuUkHmKcSznwr846rc3Gw/2+YsSiS10glA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y22-20020a170906071600b00a3cc13f497esi196932ejb.210.2024.02.12.05.19.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 05:19:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61632-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qrqViZLi; arc=pass (i=1 spf=pass spfdomain=flex--panikiel.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-61632-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61632-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id A9F971F2221E for ; Mon, 12 Feb 2024 13:19:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A669B405DB; Mon, 12 Feb 2024 13:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qrqViZLi" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 943AC3F9E6 for ; Mon, 12 Feb 2024 13:14:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707743659; cv=none; b=oy8UGoSKLEcM0KSQYc71WNY7as41QTvs7XhqpQcl6zklBbELrTZqYUBDMZKBBqg8uod2LniPHRR6jELdo+JMxtvq8ViYnpujrmuPLe1rD4nr3nCaNGLmLnJDTLvugXV4Iex4JY+dZE42W8BP2OuGOPkRk2gIiAfxTC6QxumG9xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707743659; c=relaxed/simple; bh=JSAWGIZBNCAZSWbCjPYZeQI/FYDdaMk1VJYHwKb53zs=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=h3Hpa+Pcwe8nSbKcxHeL7rWmbmMQm6i3F88H/evMrD31JEQKrTJ7iu1lNFRicTHYdPTKW7OlnBHVI2FOfY42CFFNoq9ukrReK058oOWs+a1tsKydM1WDJHz0vEh6bGYEsYw/otx5RIIt19agZCCMVdYGqTJVWlm7fMaledmSr0c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--panikiel.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qrqViZLi; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--panikiel.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dbe9e13775aso4864210276.1 for ; Mon, 12 Feb 2024 05:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707743656; x=1708348456; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:from:to:cc:subject:date:message-id:reply-to; bh=kvuLvApdM/ZlGaK4NZuFt8gRWwgyTlGJWJvpEXVTb1w=; b=qrqViZLizdf0aql/k5PcPKn8ORvJ/+FSAIqs6eRLaRQkbEWsMnwesFc05DXnMomrqN laYghTiRnmMOv5Wnn2xG7XsNa2rD4FX+b6QhiIgnK27ccPXQ9f4gmn5YBkuJxP59Cr7+ iWXIij8WbEwDyQPUbVh/HF6WAip+9MXLO6Zm1xzGsAgeOVRC+OWu6mpkEsWwxyJlAoxu mDRBvzKfwcg01c0hcDSIunAvthrNGesWdCL/ZvBHVmSCR2WhqDc1Pla5ntrFNX4KoJ+N OdsIZrzlXJ09GpbwwKNT1xLtmB53RoD5frXE7/VkH64gnM+T94Th9jOXgMniT30z2v8X duWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707743656; x=1708348456; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kvuLvApdM/ZlGaK4NZuFt8gRWwgyTlGJWJvpEXVTb1w=; b=DxRTicKb6jR9ki/FfpxNlgcq6eRt4FtqdUQO4gXn1loztFZxkjQfifeGbiNtQ9wstE DwDAqRQir5+98ALd1TIrSk7/lq8gKI4g4PAlacjTb7Tl7L53Qvw0Gh6oPktRitUdmXfQ KfSx/9V2RLOAcCXkY02pyisGuz4JxxUgE0KWu/BMWfN7dlYaQp/IFMzEFQ6UUB8w13yb 1Isb1c/9OOlaQDrsbIlxZMPeT23H2707o2trUpGteqruU2/jlQpfcMglV+zjBo0mmiPc 8PQKL+Ic04voG378zHvwAEqafpuXQKYvasHehRbw+qqKWf+gmrr1YPN7myGXaFNupZF9 cOwA== X-Forwarded-Encrypted: i=1; AJvYcCX9RRN0gsRw0rtCjOKrRSK7UUfaKoDyn0LBO3uT0TwB4lbuPTJ/Jgdj1twBT0FIw/zJx67ovAWsaFZs+5XoSbfPFK/QOhTvNIYoVl6W X-Gm-Message-State: AOJu0Yz+MXfXYGiLjb34cBfMLh4QUjoEFmbMerRF+tuwWNam85O3lskG l63MmgAxJBfJMIjZJFnGMWjQdzfhqEhhinZx7WQSr8s0X+9HKWrGLiFuygEGLfJk/Kk7WXUrU6q hAJOssmX+vQ== X-Received: from szatan.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:2d83]) (user=panikiel job=sendgmr) by 2002:a05:6902:120c:b0:dc6:e5d3:5f03 with SMTP id s12-20020a056902120c00b00dc6e5d35f03mr1820499ybu.4.1707743656565; Mon, 12 Feb 2024 05:14:16 -0800 (PST) Date: Mon, 12 Feb 2024 13:13:14 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Message-ID: <20240212131323.2162161-1-panikiel@google.com> Subject: [PATCH 0/9] Add Chameleon v3 video support From: " =?utf-8?q?Pawe=C5=82_Anikiel?= " To: airlied@gmail.com, akpm@linux-foundation.org, conor+dt@kernel.org, daniel@ffwll.ch, dinguyen@kernel.org, hverkuil-cisco@xs4all.nl, krzysztof.kozlowski+dt@linaro.org, maarten.lankhorst@linux.intel.com, mchehab@kernel.org, mripard@kernel.org, robh+dt@kernel.org, tzimmermann@suse.de Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, chromeos-krk-upstreaming@google.com, ribalda@chromium.org, " =?utf-8?q?Pawe?= =?utf-8?q?=C5=82_Anikiel?= " X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790699371566577624 X-GMAIL-MSGID: 1790699371566577624 Google Chameleon v3 is a testing device capable of emulating multiple DisplayPort monitors, used for testing purposes. It is based on an Arria 10 SoCFPGA. This patchset adds V4L2 drivers for two IP blocks used in the device's FPGA: the Chameleon v3 framebuffer, and the Intel DisplayPort RX IP. The former is a video capture device that takes video signal and writes frames into memory, which can be later processed by userspace. The latter is a DisplayPort receiver IP from Intel, its datasheet can be found at: https://www.intel.com/programmable/technical-pdfs/683273.pdf The framebuffer driver is a regular v4l2 capture device driver, while the DP RX driver is a v4l2 subdevice driver. In order to avoid code duplication, some parts of the DisplayPort code from the DRM subsystem were put into headers usable by the DP RX driver. Apart from that, the patchset adds a new callback to the internal v4l2 subdevice API to allow querying the dv timings of individual video streams of the DP receiver. Paweł Anikiel (9): media: v4l2-subdev: Add a pad variant of .query_dv_timings() media: Add Chameleon v3 framebuffer driver drm/dp_mst: Move DRM-independent structures to separate header lib: Move DisplayPort CRC functions to common lib drm/display: Add mask definitions for DP_PAYLOAD_ALLOCATE_* registers media: intel: Add Displayport RX IP driver media: dt-bindings: Add Chameleon v3 framebuffer media: dt-bindings: Add Intel Displayport RX IP ARM: dts: chameleonv3: Add video device nodes .../bindings/media/google,chv3-fb.yaml | 77 + .../devicetree/bindings/media/intel,dprx.yaml | 125 + .../socfpga/socfpga_arria10_chameleonv3.dts | 130 + drivers/gpu/drm/display/Kconfig | 1 + drivers/gpu/drm/display/drm_dp_mst_topology.c | 76 +- drivers/media/platform/Kconfig | 1 + drivers/media/platform/Makefile | 1 + drivers/media/platform/google/Kconfig | 3 + drivers/media/platform/google/Makefile | 2 + .../media/platform/google/chameleonv3/Kconfig | 13 + .../platform/google/chameleonv3/Makefile | 3 + .../platform/google/chameleonv3/chv3-fb.c | 897 +++++++ drivers/media/platform/intel/Kconfig | 12 + drivers/media/platform/intel/Makefile | 1 + drivers/media/platform/intel/intel-dprx.c | 2171 +++++++++++++++++ drivers/media/v4l2-core/v4l2-subdev.c | 11 + include/drm/display/drm_dp.h | 9 +- include/drm/display/drm_dp_mst.h | 238 ++ include/drm/display/drm_dp_mst_helper.h | 232 +- include/linux/crc-dp.h | 10 + include/media/v4l2-subdev.h | 5 + lib/Kconfig | 8 + lib/Makefile | 1 + lib/crc-dp.c | 78 + 24 files changed, 3801 insertions(+), 304 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/google,chv3-fb.yaml create mode 100644 Documentation/devicetree/bindings/media/intel,dprx.yaml create mode 100644 drivers/media/platform/google/Kconfig create mode 100644 drivers/media/platform/google/Makefile create mode 100644 drivers/media/platform/google/chameleonv3/Kconfig create mode 100644 drivers/media/platform/google/chameleonv3/Makefile create mode 100644 drivers/media/platform/google/chameleonv3/chv3-fb.c create mode 100644 drivers/media/platform/intel/intel-dprx.c create mode 100644 include/drm/display/drm_dp_mst.h create mode 100644 include/linux/crc-dp.h create mode 100644 lib/crc-dp.c