mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-07-16 22:56:59 +08:00

These patches were generated from: https://github.com/raspberrypi/linux/commits/rpi-6.12.y With the following command: git format-patch -N v6.12.27..HEAD (HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e) Exceptions: - (def)configs patches - github workflows patches - applied & reverted patches - readme patches - wireless patches Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
62 lines
1.8 KiB
Diff
62 lines
1.8 KiB
Diff
From db89dabeabd2b67a87ff58b4dbade8d8a9244abd Mon Sep 17 00:00:00 2001
|
|
From: Maxime Ripard <maxime@cerno.tech>
|
|
Date: Fri, 14 Apr 2023 12:57:53 +0200
|
|
Subject: [PATCH] drm/vc4: tests: Add helper to add a new plane to a state
|
|
|
|
We'll start to add some tests for the plane state logic, so let's create
|
|
a helper to add a plane to an existing atomic state.
|
|
|
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
|
---
|
|
drivers/gpu/drm/vc4/tests/vc4_mock.h | 3 +++
|
|
drivers/gpu/drm/vc4/tests/vc4_mock_plane.c | 22 ++++++++++++++++++++++
|
|
2 files changed, 25 insertions(+)
|
|
|
|
--- a/drivers/gpu/drm/vc4/tests/vc4_mock.h
|
|
+++ b/drivers/gpu/drm/vc4/tests/vc4_mock.h
|
|
@@ -39,6 +39,9 @@ struct vc4_dummy_plane {
|
|
struct vc4_plane plane;
|
|
};
|
|
|
|
+struct vc4_dummy_plane *vc4_dummy_plane(struct kunit *test,
|
|
+ struct drm_device *drm,
|
|
+ enum drm_plane_type type);
|
|
struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm,
|
|
enum drm_plane_type type);
|
|
|
|
--- a/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c
|
|
+++ b/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c
|
|
@@ -1,6 +1,7 @@
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <drm/drm_kunit_helpers.h>
|
|
+#include <drm/drm_atomic_uapi.h>
|
|
#include <drm/drm_plane.h>
|
|
|
|
#include <kunit/test.h>
|
|
@@ -37,3 +38,24 @@ struct drm_plane *vc4_dummy_plane(struct
|
|
|
|
return plane;
|
|
}
|
|
+
|
|
+struct drm_plane *
|
|
+vc4_mock_atomic_add_plane(struct kunit *test,
|
|
+ struct drm_atomic_state *state,
|
|
+ struct drm_crtc *crtc)
|
|
+{
|
|
+ struct drm_plane_state *plane_state;
|
|
+ struct drm_plane *plane;
|
|
+ int ret;
|
|
+
|
|
+ plane = vc4_mock_find_plane_for_crtc(test, crtc);
|
|
+ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, plane);
|
|
+
|
|
+ plane_state = drm_atomic_get_plane_state(state, plane);
|
|
+ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, plane_state);
|
|
+
|
|
+ ret = drm_atomic_set_crtc_for_plane(plane_state, crtc);
|
|
+ KUNIT_EXPECT_EQ(test, ret, 0);
|
|
+
|
|
+ return plane;
|
|
+}
|