mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
drm/vc4: tests: Use custom plane state for mock
The current mock planes were just using the regular drm_plane_state, while the driver expect struct vc4_plane_state that subclasses drm_plane_state. Hook the proper implementations of reset, duplicate_state, destroy and atomic_check to create vc4_plane_state. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
This commit is contained in:
committed by
Dom Cobley
parent
fbe35047e8
commit
d6514eb0fc
@@ -10,12 +10,13 @@
|
|||||||
#include "vc4_mock.h"
|
#include "vc4_mock.h"
|
||||||
|
|
||||||
static const struct drm_plane_helper_funcs vc4_dummy_plane_helper_funcs = {
|
static const struct drm_plane_helper_funcs vc4_dummy_plane_helper_funcs = {
|
||||||
|
.atomic_check = vc4_plane_atomic_check,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct drm_plane_funcs vc4_dummy_plane_funcs = {
|
static const struct drm_plane_funcs vc4_dummy_plane_funcs = {
|
||||||
.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
|
.atomic_destroy_state = vc4_plane_destroy_state,
|
||||||
.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
|
.atomic_duplicate_state = vc4_plane_duplicate_state,
|
||||||
.reset = drm_atomic_helper_plane_reset,
|
.reset = vc4_plane_reset,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32_t vc4_dummy_plane_formats[] = {
|
static const uint32_t vc4_dummy_plane_formats[] = {
|
||||||
|
|||||||
@@ -1100,6 +1100,12 @@ int vc4_kms_load(struct drm_device *dev);
|
|||||||
struct drm_plane *vc4_plane_init(struct drm_device *dev,
|
struct drm_plane *vc4_plane_init(struct drm_device *dev,
|
||||||
enum drm_plane_type type,
|
enum drm_plane_type type,
|
||||||
uint32_t possible_crtcs);
|
uint32_t possible_crtcs);
|
||||||
|
void vc4_plane_reset(struct drm_plane *plane);
|
||||||
|
void vc4_plane_destroy_state(struct drm_plane *plane,
|
||||||
|
struct drm_plane_state *state);
|
||||||
|
struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane);
|
||||||
|
int vc4_plane_atomic_check(struct drm_plane *plane,
|
||||||
|
struct drm_atomic_state *state);
|
||||||
int vc4_plane_create_additional_planes(struct drm_device *dev);
|
int vc4_plane_create_additional_planes(struct drm_device *dev);
|
||||||
u32 vc4_plane_write_dlist(struct drm_plane *plane, u32 __iomem *dlist);
|
u32 vc4_plane_write_dlist(struct drm_plane *plane, u32 __iomem *dlist);
|
||||||
u32 vc4_plane_dlist_size(const struct drm_plane_state *state);
|
u32 vc4_plane_dlist_size(const struct drm_plane_state *state);
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ static bool plane_enabled(struct drm_plane_state *state)
|
|||||||
return state->fb && !WARN_ON(!state->crtc);
|
return state->fb && !WARN_ON(!state->crtc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane)
|
struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane)
|
||||||
{
|
{
|
||||||
struct vc4_plane_state *vc4_state;
|
struct vc4_plane_state *vc4_state;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -312,8 +312,8 @@ static struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane
|
|||||||
return &vc4_state->base;
|
return &vc4_state->base;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vc4_plane_destroy_state(struct drm_plane *plane,
|
void vc4_plane_destroy_state(struct drm_plane *plane,
|
||||||
struct drm_plane_state *state)
|
struct drm_plane_state *state)
|
||||||
{
|
{
|
||||||
struct vc4_dev *vc4 = to_vc4_dev(plane->dev);
|
struct vc4_dev *vc4 = to_vc4_dev(plane->dev);
|
||||||
struct vc4_hvs *hvs = vc4->hvs;
|
struct vc4_hvs *hvs = vc4->hvs;
|
||||||
@@ -348,7 +348,7 @@ static void vc4_plane_destroy_state(struct drm_plane *plane,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Called during init to allocate the plane's atomic state. */
|
/* Called during init to allocate the plane's atomic state. */
|
||||||
static void vc4_plane_reset(struct drm_plane *plane)
|
void vc4_plane_reset(struct drm_plane *plane)
|
||||||
{
|
{
|
||||||
struct vc4_plane_state *vc4_state;
|
struct vc4_plane_state *vc4_state;
|
||||||
|
|
||||||
@@ -2000,8 +2000,8 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
|
|||||||
* compute the dlist here and have all active plane dlists get updated
|
* compute the dlist here and have all active plane dlists get updated
|
||||||
* in the CRTC's flush.
|
* in the CRTC's flush.
|
||||||
*/
|
*/
|
||||||
static int vc4_plane_atomic_check(struct drm_plane *plane,
|
int vc4_plane_atomic_check(struct drm_plane *plane,
|
||||||
struct drm_atomic_state *state)
|
struct drm_atomic_state *state)
|
||||||
{
|
{
|
||||||
struct vc4_dev *vc4 = to_vc4_dev(plane->dev);
|
struct vc4_dev *vc4 = to_vc4_dev(plane->dev);
|
||||||
struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
|
struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
|
||||||
|
|||||||
Reference in New Issue
Block a user