Bug 90418 - Front buffer tracker is not invalidating the fb obj for DRRS/PSR
Summary: Front buffer tracker is not invalidating the fb obj for DRRS/PSR
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium critical
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-12 13:29 UTC by Ramalingam C
Modified: 2017-07-24 22:47 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Ramalingam C 2015-05-12 13:29:35 UTC
Frame Buffer change request and change completion will be notified to DRRS/PSR through invalidate call and flush call respectively.

But When the system booting, initial few seconds intel_edp_drrs_invalidate/flush called as expected. later only flush is called but not the invalidate.

Because of this DRRS wont exit from LOW refresh rate.
Comment 1 Chris Wilson 2015-05-12 17:21:38 UTC
That's the expected behaviour for fbdev since it does not wrap access to the framebuffer. Are you saying that you observe this after the display server is active?
Comment 2 Ramalingam C 2015-05-13 04:46:38 UTC
Chris,

>> That's the expected behaviour for fbdev since it does not wrap access to the framebuffer. 
Not getting the invalidate calls is expected?

>> Are you saying that you observe this after the display server is active?
Yes. Even when ubuntu Desktop is up, this behavior(absence of invalidate) is observed.
Comment 3 Chris Wilson 2015-05-13 08:00:39 UTC
(In reply to Ramalingam C from comment #2)
> Chris,
> 
> >> That's the expected behaviour for fbdev since it does not wrap access to the framebuffer. 
> Not getting the invalidate calls is expected?

For fbdev, yes.

> >> Are you saying that you observe this after the display server is active?
> Yes. Even when ubuntu Desktop is up, this behavior(absence of invalidate) is
> observed.

Since invalidate is only called at the start of a write transaction, yes. The desktop should only be flipping (not even drawing into the scanout) which only triggers flush on the change of buffers.
Comment 4 Ramalingam C 2015-05-13 11:25:11 UTC
 
> > >> Are you saying that you observe this after the display server is active?
> > Yes. Even when ubuntu Desktop is up, this behavior(absence of invalidate) is
> > observed.
> 
> Since invalidate is only called at the start of a write transaction, yes.
> The desktop should only be flipping (not even drawing into the scanout)
> which only triggers flush on the change of buffers.

Yes. But when we are opening the apps like file browser or terminal, FB will be changed hence leading to a write operation. correct me if i am wrong about this. In such scenarios also fb_obj invalidate call is not made.
Comment 5 Chris Wilson 2015-05-13 11:33:53 UTC
(In reply to Ramalingam C from comment #4)
>  
> > > >> Are you saying that you observe this after the display server is active?
> > > Yes. Even when ubuntu Desktop is up, this behavior(absence of invalidate) is
> > > observed.
> > 
> > Since invalidate is only called at the start of a write transaction, yes.
> > The desktop should only be flipping (not even drawing into the scanout)
> > which only triggers flush on the change of buffers.
> 
> Yes. But when we are opening the apps like file browser or terminal, FB will
> be changed hence leading to a write operation. correct me if i am wrong
> about this. In such scenarios also fb_obj invalidate call is not made.

The writes are to a backbuffer which is flipped to the scanout, hence no invalidate only flush from the flip.
Comment 6 Ramalingam C 2015-05-14 20:48:32 UTC
Thanks for the information Chris,

I did some experiemnts and found that intel_eDP_drrs_invalidate has to be added to the intel_frontbuffer_flip_prepare.

With this on ubuntu Desktop environment eDP Idleness DRRS is working. But to test the all corner case I am developing a IGT. In IGT environment DRRS not updated in few situations. Have to divein further for more info.

For now I have submitted a patch to add the drrs_invalidate to the frontbuffer_flip_prepare.
Comment 7 Ramalingam C 2015-06-15 06:14:55 UTC
Hi,

With following patches FB changes with flip is captured and DRRS is notified accordingly.

http://www.spinics.net/lists/intel-gfx/msg68515.html
http://www.spinics.net/lists/intel-gfx/msg68516.html

But if the FB change carried out without flip, then we dont get the fb change notification.

Might be in few places in intel_gem.c fb_obj_invalidate call is missed. Else the obj->frontbuffer_bits are not set while calling the fb_obj_invalidate.

Gem expert's eye on this will be fruitful.
Comment 8 Chris Wilson 2015-06-15 09:19:10 UTC
Hmm, invalidate is only called if the object is already bound to a fb when it is mapped. But we typically initialise the object, then bind to a fb for scanout. I guess when we pin_to_display we should also do an invalidate to catch this case.
Comment 9 Ramalingam C 2015-06-15 15:41:44 UTC
Upclocking was needed in intel_edp_drrs_invalidate and also in intel_edp_drrs_flush. Documentation on intel_edp_drrs_flush mislead to a expectation of the intel_fb_obj_invalidate for every content change in the planes. 

A change is submitted for documentation correction and also for the code change.

Thanks Daniel for finding the cause. 
Thanks Chris for helping me in the debugging.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.