mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02: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
53 lines
1.3 KiB
C
53 lines
1.3 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Copyright (C) 2015 Free Electrons
|
|
* Copyright (C) 2015 NextThing Co
|
|
*
|
|
* Maxime Ripard <maxime.ripard@free-electrons.com>
|
|
*/
|
|
|
|
#include <drm/drm_atomic.h>
|
|
#include <drm/drm_atomic_helper.h>
|
|
#include <drm/drm_blend.h>
|
|
#include <drm/drm_gem_framebuffer_helper.h>
|
|
|
|
#include "sun4i_drv.h"
|
|
#include "sun4i_framebuffer.h"
|
|
|
|
static int sun4i_de_atomic_check(struct drm_device *dev,
|
|
struct drm_atomic_commit *state)
|
|
{
|
|
int ret;
|
|
|
|
ret = drm_atomic_helper_check_modeset(dev, state);
|
|
if (ret)
|
|
return ret;
|
|
|
|
ret = drm_atomic_normalize_zpos(dev, state);
|
|
if (ret)
|
|
return ret;
|
|
|
|
return drm_atomic_helper_check_planes(dev, state);
|
|
}
|
|
|
|
static const struct drm_mode_config_funcs sun4i_de_mode_config_funcs = {
|
|
.atomic_check = sun4i_de_atomic_check,
|
|
.atomic_commit = drm_atomic_helper_commit,
|
|
.fb_create = drm_gem_fb_create,
|
|
};
|
|
|
|
static const struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers = {
|
|
.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
|
|
};
|
|
|
|
void sun4i_framebuffer_init(struct drm_device *drm)
|
|
{
|
|
drm_mode_config_reset(drm);
|
|
|
|
drm->mode_config.max_width = 8192;
|
|
drm->mode_config.max_height = 8192;
|
|
|
|
drm->mode_config.funcs = &sun4i_de_mode_config_funcs;
|
|
drm->mode_config.helper_private = &sun4i_de_mode_config_helpers;
|
|
}
|