1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (C) 2015 Free Electrons 4 * Copyright (C) 2015 NextThing Co 5 * 6 * Maxime Ripard <maxime.ripard@free-electrons.com> 7 */ 8 9 #include <drm/drm_atomic.h> 10 #include <drm/drm_atomic_helper.h> 11 #include <drm/drm_blend.h> 12 #include <drm/drm_gem_framebuffer_helper.h> 13 14 #include "sun4i_drv.h" 15 #include "sun4i_framebuffer.h" 16 17 static const struct drm_mode_config_funcs sun4i_de_mode_config_funcs = { 18 .atomic_check = drm_atomic_helper_check, 19 .atomic_commit = drm_atomic_helper_commit, 20 .fb_create = drm_gem_fb_create, 21 }; 22 23 static const struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers = { 24 .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, 25 }; 26 27 void sun4i_framebuffer_init(struct drm_device *drm) 28 { 29 drm_mode_config_reset(drm); 30 31 drm->mode_config.max_width = 8192; 32 drm->mode_config.max_height = 8192; 33 drm->mode_config.normalize_zpos = true; 34 35 drm->mode_config.funcs = &sun4i_de_mode_config_funcs; 36 drm->mode_config.helper_private = &sun4i_de_mode_config_helpers; 37 } 38