On Thu, Dec 03, 2009 at 02:26:35AM +0100, Rafał Miłecki wrote: > I need to prepare radeon driver for setting mode and detect disabling > display. I have to disable PM and eventually enable it again after > mode setting is done (only for single head configuration). My problem > is I do not know when modesetting starts and as result can not disable > PM reliably. >
Why do you need that ? PM should happen in a callback from a timer (we might want to use the HW timer for that) ie from some function called by the IRQ/MSI handler. In the PM function we should take all lock to assure that we have exclusive hw access, thus we need to take cs lock but also the lock which is protecting modesetting (iirc there is one). The first design i thought for PM long time ago was : func_compute_clock func_set_clock func_irq_powersave func_compute_clock is call any time there is a mode change to compute new minimum clock. func_set_clock is call after func_compute_clock (if we need to upclock gpu to have enough bandwidth for a new video mode) or from func_irq_powersave. func_set_clock would have to take all necessary lock to ensure exclusive hw access. func_irq_powersave is the function responsible for downclocking or not the GPU, it's call from irq handler, and it would call func_set_clock to do the work if necessary As a first pass you can ignore func_compute_clock and focus on the others 2. I think such design should allow to do powersaving the way we need to do it. Cheers, Jerome ------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel