]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/tegra: Atomic conversion, phase 2
authorThierry Reding <treding@nvidia.com>
Mon, 24 Nov 2014 16:02:53 +0000 (17:02 +0100)
committerThierry Reding <treding@nvidia.com>
Tue, 27 Jan 2015 09:14:51 +0000 (10:14 +0100)
Hook up the default ->reset() and ->atomic_duplicate_state() helpers.
This ensures that state objects are properly created and framebuffer
reference counts correctly maintained.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/dc.c
drivers/gpu/drm/tegra/drm.c
drivers/gpu/drm/tegra/dsi.c
drivers/gpu/drm/tegra/hdmi.c
drivers/gpu/drm/tegra/rgb.c
drivers/gpu/drm/tegra/sor.c

index f7254ab7a5c709666c67eddf92a515786aadf16e..6bf5014ad2dc1e0a39a9de1aff1a1c938ef02bc1 100644 (file)
@@ -18,6 +18,7 @@
 #include "drm.h"
 #include "gem.h"
 
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_plane_helper.h>
 
@@ -399,6 +400,8 @@ static const struct drm_plane_funcs tegra_primary_plane_funcs = {
        .update_plane = drm_plane_helper_update,
        .disable_plane = drm_plane_helper_disable,
        .destroy = tegra_primary_plane_destroy,
+       .reset = drm_atomic_helper_plane_reset,
+       .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
 };
 
@@ -683,6 +686,8 @@ static const struct drm_plane_funcs tegra_cursor_plane_funcs = {
        .update_plane = drm_plane_helper_update,
        .disable_plane = drm_plane_helper_disable,
        .destroy = tegra_plane_destroy,
+       .reset = drm_atomic_helper_plane_reset,
+       .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
 };
 
@@ -731,6 +736,8 @@ static const struct drm_plane_funcs tegra_overlay_plane_funcs = {
        .update_plane = drm_plane_helper_update,
        .disable_plane = drm_plane_helper_disable,
        .destroy = tegra_overlay_plane_destroy,
+       .reset = drm_atomic_helper_plane_reset,
+       .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
 };
 
@@ -983,6 +990,9 @@ static int tegra_dc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
                drm_crtc_vblank_get(crtc);
        }
 
+       if (crtc->primary->state)
+               drm_atomic_set_fb_for_plane(crtc->primary->state, fb);
+
        tegra_dc_set_base(dc, 0, 0, fb);
        crtc->primary->fb = fb;
 
@@ -998,6 +1008,8 @@ static const struct drm_crtc_funcs tegra_crtc_funcs = {
        .page_flip = tegra_dc_page_flip,
        .set_config = drm_crtc_helper_set_config,
        .destroy = tegra_dc_destroy,
+       .reset = drm_atomic_helper_crtc_reset,
+       .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
 };
 
index 0e0da86f627ce14bd3d1676d35c03510cd24fdcd..c1bb0d90145489b206a16b65116028fbfbc9f8bb 100644 (file)
@@ -77,6 +77,8 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
        if (err < 0)
                goto fbdev;
 
+       drm_mode_config_reset(drm);
+
        /*
         * We don't use the drm_irq_install() helpers provided by the DRM
         * core, so we need to set this manually in order to allow the
index 234cd1c3079ff4d701ea477551a4c02d94e26286..d98058dc4580cf2433380f1d3edf9856776b7e8e 100644 (file)
@@ -734,9 +734,11 @@ static void tegra_dsi_connector_dpms(struct drm_connector *connector, int mode)
 
 static const struct drm_connector_funcs tegra_dsi_connector_funcs = {
        .dpms = tegra_dsi_connector_dpms,
+       .reset = drm_atomic_helper_connector_reset,
        .detect = tegra_output_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
        .destroy = tegra_output_connector_destroy,
+       .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
index bf868d54ef7e0f0de3929074a803c500b5570cb3..728681a3f8c9d6fc23bc1b5842c123069bc90739 100644 (file)
@@ -779,9 +779,11 @@ static void tegra_hdmi_connector_dpms(struct drm_connector *connector,
 
 static const struct drm_connector_funcs tegra_hdmi_connector_funcs = {
        .dpms = tegra_hdmi_connector_dpms,
+       .reset = drm_atomic_helper_connector_reset,
        .detect = tegra_output_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
        .destroy = tegra_output_connector_destroy,
+       .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
index 23ba40370eb26c4abff65eac3cfa800c328e8223..78e3cb1529d0709d4329c09de34c1f8959496929 100644 (file)
@@ -95,9 +95,11 @@ static void tegra_rgb_connector_dpms(struct drm_connector *connector,
 
 static const struct drm_connector_funcs tegra_rgb_connector_funcs = {
        .dpms = tegra_rgb_connector_dpms,
+       .reset = drm_atomic_helper_connector_reset,
        .detect = tegra_output_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
        .destroy = tegra_output_connector_destroy,
+       .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
index e2f399363f09388eb9ee6b9a977a58ef97898f7c..2793e75c657371fd89765fc22c131f374d5af5ff 100644 (file)
@@ -735,9 +735,11 @@ tegra_sor_connector_detect(struct drm_connector *connector, bool force)
 
 static const struct drm_connector_funcs tegra_sor_connector_funcs = {
        .dpms = tegra_sor_connector_dpms,
+       .reset = drm_atomic_helper_connector_reset,
        .detect = tegra_sor_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
        .destroy = tegra_output_connector_destroy,
+       .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };