2 * Copyright (C) 2012 Avionic Design GmbH
3 * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
12 static void tegra_drm_fb_output_poll_changed(struct drm_device
*drm
)
14 struct host1x_drm
*host1x
= drm
->dev_private
;
16 drm_fbdev_cma_hotplug_event(host1x
->fbdev
);
19 static const struct drm_mode_config_funcs tegra_drm_mode_funcs
= {
20 .fb_create
= drm_fb_cma_create
,
21 .output_poll_changed
= tegra_drm_fb_output_poll_changed
,
24 int tegra_drm_fb_init(struct drm_device
*drm
)
26 struct host1x_drm
*host1x
= drm
->dev_private
;
27 struct drm_fbdev_cma
*fbdev
;
29 drm
->mode_config
.min_width
= 0;
30 drm
->mode_config
.min_height
= 0;
32 drm
->mode_config
.max_width
= 4096;
33 drm
->mode_config
.max_height
= 4096;
35 drm
->mode_config
.funcs
= &tegra_drm_mode_funcs
;
37 fbdev
= drm_fbdev_cma_init(drm
, 32, drm
->mode_config
.num_crtc
,
38 drm
->mode_config
.num_connector
);
40 return PTR_ERR(fbdev
);
42 host1x
->fbdev
= fbdev
;
47 void tegra_drm_fb_exit(struct drm_device
*drm
)
49 struct host1x_drm
*host1x
= drm
->dev_private
;
51 drm_fbdev_cma_fini(host1x
->fbdev
);