From: Dave Airlie Date: Fri, 14 Aug 2015 00:14:23 +0000 (+1000) Subject: Merge branch 'drm-sti-next-atomic-2015-08-11' of http://git.linaro.org/people/benjami... X-Git-Tag: v4.3~229^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1474e7bdf6b16db41cc12b8e7b3fefd8668f3cf;p=platform%2Fkernel%2Flinux-amlogic.git Merge branch 'drm-sti-next-atomic-2015-08-11' of git.linaro.org/people/benjamin.gaignard/kernel into drm-next 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 --- e1474e7bdf6b16db41cc12b8e7b3fefd8668f3cf diff --cc drivers/gpu/drm/sti/sti_crtc.c index 26e63bf,23fc2db..018ffc9 --- a/drivers/gpu/drm/sti/sti_crtc.c +++ b/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); @@@ -179,9 -156,72 +157,73 @@@ } } - 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 = {