mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-29 11:37:59 -04:00
The KMS framework uses two slightly different definitions for the state concept. For a given object (plane, CRTC, encoder, etc., so drm_$OBJECT_state), the state is the entire state of that object. However, at the device level, drm_atomic_state refers to a state update for a limited number of objects. Thus, drm_atomic_state isn't the entire device state, but only the full state of some objects in that device. This has been an endless source of confusion and thus bugs. We can rename the drm_atomic_state structure to drm_atomic_commit to make it less confusing. This patch was created using: rg -l drm_atomic_state | \ xargs sed -i 's/drm_atomic_state/drm_atomic_commit/g; s/drm_atomic_commit_helper/drm_atomic_state_helper/g' mv drivers/gpu/drm/tests/drm_atomic_state_test.c drivers/gpu/drm/tests/drm_atomic_commit_test.c Acked-by: Simona Vetter <simona.vetter@ffwll.ch> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260427-drm-drm-atomic-update-v4-1-c0e713bfdf25@kernel.org
62 lines
1.6 KiB
C
62 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef VC4_MOCK_H_
|
|
#define VC4_MOCK_H_
|
|
|
|
#include "../vc4_drv.h"
|
|
|
|
static inline
|
|
struct drm_crtc *vc4_find_crtc_for_encoder(struct kunit *test,
|
|
struct drm_device *drm,
|
|
struct drm_encoder *encoder)
|
|
{
|
|
struct drm_crtc *crtc;
|
|
|
|
KUNIT_ASSERT_EQ(test, hweight32(encoder->possible_crtcs), 1);
|
|
|
|
drm_for_each_crtc(crtc, drm)
|
|
if (encoder->possible_crtcs & drm_crtc_mask(crtc))
|
|
return crtc;
|
|
|
|
return NULL;
|
|
}
|
|
|
|
struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm,
|
|
enum drm_plane_type type);
|
|
|
|
struct vc4_dummy_crtc {
|
|
struct vc4_crtc crtc;
|
|
};
|
|
|
|
struct vc4_dummy_crtc *vc4_mock_pv(struct kunit *test,
|
|
struct drm_device *drm,
|
|
struct drm_plane *plane,
|
|
const struct vc4_crtc_data *data);
|
|
|
|
struct vc4_dummy_output {
|
|
struct vc4_encoder encoder;
|
|
struct drm_connector connector;
|
|
};
|
|
|
|
#define encoder_to_vc4_dummy_output(_enc) \
|
|
container_of_const(_enc, struct vc4_dummy_output, encoder.base)
|
|
|
|
struct vc4_dummy_output *vc4_dummy_output(struct kunit *test,
|
|
struct drm_device *drm,
|
|
struct drm_crtc *crtc,
|
|
enum vc4_encoder_type vc4_encoder_type,
|
|
unsigned int kms_encoder_type,
|
|
unsigned int connector_type);
|
|
|
|
struct vc4_dev *vc4_mock_device(struct kunit *test);
|
|
struct vc4_dev *vc5_mock_device(struct kunit *test);
|
|
|
|
int vc4_mock_atomic_add_output(struct kunit *test,
|
|
struct drm_atomic_commit *state,
|
|
enum vc4_encoder_type type);
|
|
int vc4_mock_atomic_del_output(struct kunit *test,
|
|
struct drm_atomic_commit *state,
|
|
enum vc4_encoder_type type);
|
|
|
|
#endif // VC4_MOCK_H_
|