mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 08:21:14 +00:00
88 lines
2.8 KiB
Diff
88 lines
2.8 KiB
Diff
|
From 04bec005b049604f862765b35ebd71c2a69b9e7c Mon Sep 17 00:00:00 2001
|
||
|
From: Maxime Ripard <maxime@cerno.tech>
|
||
|
Date: Fri, 17 Feb 2023 13:38:10 +0100
|
||
|
Subject: [PATCH] drm/vc4: tests: Add BCM2712 mock driver
|
||
|
|
||
|
The BCM2712 has a simpler pipeline that can only output to a writeback
|
||
|
connector and two HDMI controllers.
|
||
|
|
||
|
Let's allow our kunit tests to create a mock of that pipeline.
|
||
|
|
||
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||
|
---
|
||
|
drivers/gpu/drm/vc4/tests/vc4_mock.c | 29 ++++++++++++++++++++++++++++
|
||
|
drivers/gpu/drm/vc4/tests/vc4_mock.h | 1 +
|
||
|
drivers/gpu/drm/vc4/vc4_drv.h | 2 ++
|
||
|
3 files changed, 32 insertions(+)
|
||
|
|
||
|
--- a/drivers/gpu/drm/vc4/tests/vc4_mock.c
|
||
|
+++ b/drivers/gpu/drm/vc4/tests/vc4_mock.c
|
||
|
@@ -106,6 +106,26 @@ static const struct vc4_mock_desc vc5_mo
|
||
|
DRM_MODE_CONNECTOR_HDMIA)),
|
||
|
);
|
||
|
|
||
|
+static const struct vc4_mock_desc vc6_mock =
|
||
|
+ VC4_MOCK_DESC(
|
||
|
+ VC4_MOCK_CRTC_DESC(&bcm2712_mop_data.base,
|
||
|
+ VC4_MOCK_OUTPUT_DESC(VC4_ENCODER_TYPE_TXP0,
|
||
|
+ DRM_MODE_ENCODER_VIRTUAL,
|
||
|
+ DRM_MODE_CONNECTOR_WRITEBACK)),
|
||
|
+ VC4_MOCK_CRTC_DESC(&bcm2712_moplet_data.base,
|
||
|
+ VC4_MOCK_OUTPUT_DESC(VC4_ENCODER_TYPE_TXP1,
|
||
|
+ DRM_MODE_ENCODER_VIRTUAL,
|
||
|
+ DRM_MODE_CONNECTOR_WRITEBACK)),
|
||
|
+ VC4_MOCK_PIXELVALVE_DESC(&bcm2712_pv0_data,
|
||
|
+ VC4_MOCK_OUTPUT_DESC(VC4_ENCODER_TYPE_HDMI0,
|
||
|
+ DRM_MODE_ENCODER_TMDS,
|
||
|
+ DRM_MODE_CONNECTOR_HDMIA)),
|
||
|
+ VC4_MOCK_PIXELVALVE_DESC(&bcm2712_pv1_data,
|
||
|
+ VC4_MOCK_OUTPUT_DESC(VC4_ENCODER_TYPE_HDMI1,
|
||
|
+ DRM_MODE_ENCODER_TMDS,
|
||
|
+ DRM_MODE_CONNECTOR_HDMIA)),
|
||
|
+);
|
||
|
+
|
||
|
static int __build_one_pipe(struct kunit *test, struct drm_device *drm,
|
||
|
const struct vc4_mock_pipe_desc *pipe)
|
||
|
{
|
||
|
@@ -171,6 +191,10 @@ static struct vc4_dev *__mock_device(str
|
||
|
drv = &vc5_drm_driver;
|
||
|
desc = &vc5_mock;
|
||
|
break;
|
||
|
+ case VC4_GEN_6:
|
||
|
+ drv = &vc5_drm_driver;
|
||
|
+ desc = &vc6_mock;
|
||
|
+ break;
|
||
|
|
||
|
default:
|
||
|
return NULL;
|
||
|
@@ -212,3 +236,8 @@ struct vc4_dev *vc5_mock_device(struct k
|
||
|
{
|
||
|
return __mock_device(test, VC4_GEN_5);
|
||
|
}
|
||
|
+
|
||
|
+struct vc4_dev *vc6_mock_device(struct kunit *test)
|
||
|
+{
|
||
|
+ return __mock_device(test, VC4_GEN_6);
|
||
|
+}
|
||
|
--- a/drivers/gpu/drm/vc4/tests/vc4_mock.h
|
||
|
+++ b/drivers/gpu/drm/vc4/tests/vc4_mock.h
|
||
|
@@ -52,6 +52,7 @@ struct vc4_dummy_output *vc4_dummy_outpu
|
||
|
|
||
|
struct vc4_dev *vc4_mock_device(struct kunit *test);
|
||
|
struct vc4_dev *vc5_mock_device(struct kunit *test);
|
||
|
+struct vc4_dev *vc6_mock_device(struct kunit *test);
|
||
|
|
||
|
struct vc4_dummy_output *
|
||
|
vc4_mock_atomic_add_output(struct kunit *test,
|
||
|
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
||
|
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
||
|
@@ -570,6 +570,8 @@ struct vc4_txp_data {
|
||
|
unsigned int supports_40bit_addresses:1;
|
||
|
};
|
||
|
|
||
|
+extern const struct vc4_txp_data bcm2712_mop_data;
|
||
|
+extern const struct vc4_txp_data bcm2712_moplet_data;
|
||
|
extern const struct vc4_txp_data bcm2835_txp_data;
|
||
|
|
||
|
struct vc4_pv_data {
|