On 2015-07-03 05:30, Michel Dänzer wrote: > > This could be done in the same loop as the front buffers. >
Sure, I just thought it looks cleaner this way. > On resume, the cursor BO is currently pinned again by > radeon_cursor_reset -> radeon_set_cursor. However, radeon_cursor_reset > is also called when changing the video mode, in which case it causes > the > cursor BO pin count to increase by 1 for each CRTC using it. > Presumably, > the mouse cursor would end up broken again on suspend/resume after that > for you. > Indeed. It seems to be problematic overall that radeon_cursor_reset does unconditionally increment the pin count. As soon as a mode is switched with cursor enabled, the cursor BO will stay pinned forever. > We need a solution which pins the BO again on resume but doesn't > increase the pin count during a mode change. I'm not sure right now > what > the best way is to achieve that, I'll think about it more later. How about this: Never let radeon_set_cursor mess with the pin count, do that in radeon_crtc_cursor_set2 only, and make sure that the reference^Wpin count is updated accordingly (i.e. exactly one pin per crtc). Then add some explicit cursor resume code that traverses the crtc list and re-pins as needed. Maybe that that nice, but should work. Grigori