diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-09-21 10:07:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-21 09:15:00 -0700 |
commit | e692da4d0e587f549ba101015e5f89903ba20b67 (patch) | |
tree | 6493d97bef8e3a459160e742b2b4a54b31b87ae9 /drivers/staging/imx-drm/imx-fb.c | |
parent | f34170c762e88512796be7f94df80f294d12de95 (diff) | |
download | op-kernel-dev-e692da4d0e587f549ba101015e5f89903ba20b67.zip op-kernel-dev-e692da4d0e587f549ba101015e5f89903ba20b67.tar.gz |
staging: drm/imx: Add i.MX drm core support
This patch adds the i.MX glue stuff between i.MX and drm.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/imx-drm/imx-fb.c')
-rw-r--r-- | drivers/staging/imx-drm/imx-fb.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/staging/imx-drm/imx-fb.c b/drivers/staging/imx-drm/imx-fb.c new file mode 100644 index 0000000..03a7b4e --- /dev/null +++ b/drivers/staging/imx-drm/imx-fb.c @@ -0,0 +1,47 @@ +/* + * i.MX drm driver + * + * Copyright (C) 2012 Sascha Hauer, Pengutronix + * + * Based on Samsung Exynos code + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ +#include <linux/module.h> +#include <drm/drmP.h> +#include <drm/drm_crtc.h> +#include <drm/drm_crtc_helper.h> +#include <drm/drm_gem_cma_helper.h> +#include <drm/drm_fb_cma_helper.h> + +#include "imx-drm.h" + +static struct drm_mode_config_funcs imx_drm_mode_config_funcs = { + .fb_create = drm_fb_cma_create, +}; + +void imx_drm_mode_config_init(struct drm_device *dev) +{ + dev->mode_config.min_width = 64; + dev->mode_config.min_height = 64; + + /* + * set max width and height as default value(4096x4096). + * this value would be used to check framebuffer size limitation + * at drm_mode_addfb(). + */ + dev->mode_config.max_width = 4096; + dev->mode_config.max_height = 4096; + + dev->mode_config.funcs = &imx_drm_mode_config_funcs; +} |