drm/tegra: Move tegra_drm_mode_funcs to the core
[deliverable/linux.git] / drivers / gpu / drm / tegra / drm.c
index d4f827593dfa2041a386dba733f9436cbed1d111..e29d9146b7c74ca27973b923c9b4eab6558745e3 100644 (file)
@@ -24,6 +24,13 @@ struct tegra_drm_file {
        struct list_head contexts;
 };
 
+static const struct drm_mode_config_funcs tegra_drm_mode_funcs = {
+       .fb_create = tegra_fb_create,
+#ifdef CONFIG_DRM_TEGRA_FBDEV
+       .output_poll_changed = tegra_fb_output_poll_changed,
+#endif
+};
+
 static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
 {
        struct host1x_device *device = to_host1x_device(drm->dev);
@@ -36,8 +43,8 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
 
        if (iommu_present(&platform_bus_type)) {
                tegra->domain = iommu_domain_alloc(&platform_bus_type);
-               if (IS_ERR(tegra->domain)) {
-                       err = PTR_ERR(tegra->domain);
+               if (!tegra->domain) {
+                       err = -ENOMEM;
                        goto free;
                }
 
@@ -52,6 +59,14 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
 
        drm_mode_config_init(drm);
 
+       drm->mode_config.min_width = 0;
+       drm->mode_config.min_height = 0;
+
+       drm->mode_config.max_width = 4096;
+       drm->mode_config.max_height = 4096;
+
+       drm->mode_config.funcs = &tegra_drm_mode_funcs;
+
        err = tegra_drm_fb_prepare(drm);
        if (err < 0)
                goto config;
@@ -912,7 +927,9 @@ static const struct of_device_id host1x_drm_subdevs[] = {
 };
 
 static struct host1x_driver host1x_drm_driver = {
-       .name = "drm",
+       .driver = {
+               .name = "drm",
+       },
        .probe = host1x_drm_probe,
        .remove = host1x_drm_remove,
        .subdevs = host1x_drm_subdevs,
This page took 0.025701 seconds and 5 git commands to generate.