Commit a8cecf33 authored by Rob Clark's avatar Rob Clark

drm/msm/mdp5: drop attached planes table

Simplify things a bit for atomic, gets rid of some bookkeeping, and
makes the code cleaner.
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent bb6c018d
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
struct mdp5_crtc { struct mdp5_crtc {
struct drm_crtc base; struct drm_crtc base;
char name[8]; char name[8];
struct drm_plane *planes[8];
int id; int id;
bool enabled; bool enabled;
...@@ -77,15 +76,14 @@ static void crtc_flush(struct drm_crtc *crtc) ...@@ -77,15 +76,14 @@ static void crtc_flush(struct drm_crtc *crtc)
struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
struct mdp5_kms *mdp5_kms = get_kms(crtc); struct mdp5_kms *mdp5_kms = get_kms(crtc);
int id = mdp5_crtc->id; int id = mdp5_crtc->id;
uint32_t i, flush = 0; struct drm_plane *plane;
uint32_t flush = 0;
for (i = 0; i < ARRAY_SIZE(mdp5_crtc->planes); i++) { for_each_plane_on_crtc(crtc, plane) {
struct drm_plane *plane = mdp5_crtc->planes[i];
if (plane) {
enum mdp5_pipe pipe = mdp5_plane_pipe(plane); enum mdp5_pipe pipe = mdp5_plane_pipe(plane);
flush |= pipe2flush(pipe); flush |= pipe2flush(pipe);
} }
}
flush |= mixer2flush(mdp5_crtc->id); flush |= mixer2flush(mdp5_crtc->id);
flush |= MDP5_CTL_FLUSH_CTL; flush |= MDP5_CTL_FLUSH_CTL;
...@@ -141,7 +139,8 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file) ...@@ -141,7 +139,8 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file)
struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_pending_vblank_event *event; struct drm_pending_vblank_event *event;
unsigned long flags, i; struct drm_plane *plane;
unsigned long flags;
spin_lock_irqsave(&dev->event_lock, flags); spin_lock_irqsave(&dev->event_lock, flags);
event = mdp5_crtc->event; event = mdp5_crtc->event;
...@@ -157,11 +156,8 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file) ...@@ -157,11 +156,8 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file)
} }
spin_unlock_irqrestore(&dev->event_lock, flags); spin_unlock_irqrestore(&dev->event_lock, flags);
for (i = 0; i < ARRAY_SIZE(mdp5_crtc->planes); i++) { for_each_plane_on_crtc(crtc, plane)
struct drm_plane *plane = mdp5_crtc->planes[i];
if (plane)
mdp5_plane_complete_flip(plane); mdp5_plane_complete_flip(plane);
}
} }
static void pageflip_cb(struct msm_fence_cb *cb) static void pageflip_cb(struct msm_fence_cb *cb)
...@@ -502,12 +498,6 @@ static void set_attach(struct drm_crtc *crtc, enum mdp5_pipe pipe_id, ...@@ -502,12 +498,6 @@ static void set_attach(struct drm_crtc *crtc, enum mdp5_pipe pipe_id,
{ {
struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
BUG_ON(pipe_id >= ARRAY_SIZE(mdp5_crtc->planes));
if (mdp5_crtc->planes[pipe_id] == plane)
return;
mdp5_crtc->planes[pipe_id] = plane;
blend_setup(crtc); blend_setup(crtc);
if (mdp5_crtc->enabled && (plane != crtc->primary)) if (mdp5_crtc->enabled && (plane != crtc->primary))
crtc_flush(crtc); crtc_flush(crtc);
...@@ -554,6 +544,7 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev, ...@@ -554,6 +544,7 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev,
drm_crtc_init_with_planes(dev, crtc, plane, NULL, &mdp5_crtc_funcs); drm_crtc_init_with_planes(dev, crtc, plane, NULL, &mdp5_crtc_funcs);
drm_crtc_helper_add(crtc, &mdp5_crtc_helper_funcs); drm_crtc_helper_add(crtc, &mdp5_crtc_helper_funcs);
plane->crtc = crtc;
mdp5_plane_install_properties(plane, &crtc->base); mdp5_plane_install_properties(plane, &crtc->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment