OSDN Git Service

Merge branch 'drm-sti-next-atomic-2015-08-11' of http://git.linaro.org/people/benjami...
authorDave Airlie <airlied@redhat.com>
Fri, 14 Aug 2015 00:14:23 +0000 (10:14 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 14 Aug 2015 00:14:23 +0000 (10:14 +1000)
This serie of patches fix minor bugs around how driver sub-components are
bind and planes z-ordering.
The main part is about atomic support: using more atomic helpers allow us
to simplify the code (~300 lines removed) and to ahve a better match between
drm concepts (planes and crtc) and hardware split.

[airlied: fixed up conflict in atomic code]

* 'drm-sti-next-atomic-2015-08-11' of http://git.linaro.org/people/benjamin.gaignard/kernel:
  drm/sti: atomic crtc/plane update
  drm/sti: rename files and functions
  drm/sti: code clean up
  drm/sti: fix dynamic z-ordering
  drm: sti: fix sub-components bind

1  2 
drivers/gpu/drm/sti/sti_crtc.c

@@@ -158,14 -136,13 +136,14 @@@ static void sti_crtc_disable(struct drm
  }
  
  static void
- sti_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
+ sti_crtc_mode_set_nofb(struct drm_crtc *crtc)
  {
-       sti_drm_crtc_prepare(crtc);
-       sti_drm_crtc_mode_set(crtc, &crtc->state->adjusted_mode);
+       sti_crtc_enable(crtc);
+       sti_crtc_mode_set(crtc, &crtc->state->adjusted_mode);
  }
  
- static void sti_drm_atomic_begin(struct drm_crtc *crtc,
-                                struct drm_crtc_state *old_crtc_state)
 -static void sti_crtc_atomic_begin(struct drm_crtc *crtc)
++static void sti_crtc_atomic_begin(struct drm_crtc *crtc,
++                                struct drm_crtc_state *old_crtc_state)
  {
        struct sti_mixer *mixer = to_sti_mixer(crtc);
  
        }
  }
  
- static void sti_drm_atomic_flush(struct drm_crtc *crtc,
-                                struct drm_crtc_state *old_crtc_state)
 -static void sti_crtc_atomic_flush(struct drm_crtc *crtc)
++static void sti_crtc_atomic_flush(struct drm_crtc *crtc,
++                                struct drm_crtc_state *old_crtc_state)
  {
+       struct drm_device *drm_dev = crtc->dev;
+       struct sti_mixer *mixer = to_sti_mixer(crtc);
+       struct sti_compositor *compo = dev_get_drvdata(mixer->dev);
+       struct drm_plane *p;
+       DRM_DEBUG_DRIVER("\n");
+       /* perform plane actions */
+       list_for_each_entry(p, &drm_dev->mode_config.plane_list, head) {
+               struct sti_plane *plane = to_sti_plane(p);
+               switch (plane->status) {
+               case STI_PLANE_UPDATED:
+                       /* update planes tag as updated */
+                       DRM_DEBUG_DRIVER("update plane %s\n",
+                                        sti_plane_to_str(plane));
+                       if (sti_mixer_set_plane_depth(mixer, plane)) {
+                               DRM_ERROR("Cannot set plane %s depth\n",
+                                         sti_plane_to_str(plane));
+                               break;
+                       }
+                       if (sti_mixer_set_plane_status(mixer, plane, true)) {
+                               DRM_ERROR("Cannot enable plane %s at mixer\n",
+                                         sti_plane_to_str(plane));
+                               break;
+                       }
+                       /* if plane is HQVDP_0 then commit the vid[0] */
+                       if (plane->desc == STI_HQVDP_0)
+                               sti_vid_commit(compo->vid[0], p->state);
+                       plane->status = STI_PLANE_READY;
+                       break;
+               case STI_PLANE_DISABLING:
+                       /* disabling sequence for planes tag as disabling */
+                       DRM_DEBUG_DRIVER("disable plane %s from mixer\n",
+                                        sti_plane_to_str(plane));
+                       if (sti_mixer_set_plane_status(mixer, plane, false)) {
+                               DRM_ERROR("Cannot disable plane %s at mixer\n",
+                                         sti_plane_to_str(plane));
+                               continue;
+                       }
+                       if (plane->desc == STI_CURSOR)
+                               /* tag plane status for disabled */
+                               plane->status = STI_PLANE_DISABLED;
+                       else
+                               /* tag plane status for flushing */
+                               plane->status = STI_PLANE_FLUSHING;
+                       /* if plane is HQVDP_0 then disable the vid[0] */
+                       if (plane->desc == STI_HQVDP_0)
+                               sti_vid_disable(compo->vid[0]);
+                       break;
+               default:
+                       /* Other status case are not handled */
+                       break;
+               }
+       }
  }
  
  static struct drm_crtc_helper_funcs sti_crtc_helper_funcs = {