0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <drm/drm_atomic.h>
0010 #include <drm/drm_atomic_helper.h>
0011 #include <drm/drm_blend.h>
0012 #include <drm/drm_gem_framebuffer_helper.h>
0013
0014 #include "sun4i_drv.h"
0015 #include "sun4i_framebuffer.h"
0016
0017 static int sun4i_de_atomic_check(struct drm_device *dev,
0018 struct drm_atomic_state *state)
0019 {
0020 int ret;
0021
0022 ret = drm_atomic_helper_check_modeset(dev, state);
0023 if (ret)
0024 return ret;
0025
0026 ret = drm_atomic_normalize_zpos(dev, state);
0027 if (ret)
0028 return ret;
0029
0030 return drm_atomic_helper_check_planes(dev, state);
0031 }
0032
0033 static const struct drm_mode_config_funcs sun4i_de_mode_config_funcs = {
0034 .atomic_check = sun4i_de_atomic_check,
0035 .atomic_commit = drm_atomic_helper_commit,
0036 .fb_create = drm_gem_fb_create,
0037 };
0038
0039 static const struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers = {
0040 .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
0041 };
0042
0043 void sun4i_framebuffer_init(struct drm_device *drm)
0044 {
0045 drm_mode_config_reset(drm);
0046
0047 drm->mode_config.max_width = 8192;
0048 drm->mode_config.max_height = 8192;
0049
0050 drm->mode_config.funcs = &sun4i_de_mode_config_funcs;
0051 drm->mode_config.helper_private = &sun4i_de_mode_config_helpers;
0052 }