On 11/24/16 11:29, Tomi Valkeinen wrote:
@@ -213,6 +274,13 @@ static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown)
__func__);
}
- /*
* LCDC will not retain the palette when reset. Make sure it gets
* reloaded on tilcdc_crtc_enable().
*/
- if (priv->rev == 1)
reinit_completion(&tilcdc_crtc->palette_loaded);
So when the crtc is disabled, you do this, so that on crtc enable the driver would load palette? When is the crtc enabled if it hasn't been disabled first? In other words, when will the palette loading in tilcdc_crtc_enable() _not_ trigger for v1?
This looks a bit messy to me.
Why not just load the palette every time on crtc enable? And reinit the completion in tilcdc_crtc_load_palette().
My final version loads it at the end of modeset_nofb(), to avoid this:
1. Load the fb address to dma registers with "ingenious" 64 bit write
2. Load the dma registers to a temporary storrage
3. Put palette address in dma registers and load the palette
4. Restore the dma registers (= fb address)
But, sure. I can load the palette every time the mode changes, but not every time the display is enabled.
Thanks, Jyri