mirror of https://gitee.com/openkylin/linux.git
- Some new documentation for GEM shmem madvise helpers
- Fix for a state dereference in atomic self-refresh helpers - One compilation fix for c2p fbdev helpers -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXcPUHwAKCRDj7w1vZxhR xfQ+AQDqa+ddvrlr9S0lAwv3R6iH8E9/uk1/PaKJEEyPFL6lQgEA7lNWpgWKuSDx fpY3uqEhV1sNcCmBan968wjySi6BpwY= =b9Yc -----END PGP SIGNATURE----- Merge tag 'drm-misc-fixes-2019-11-07-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes - Some new documentation for GEM shmem madvise helpers - Fix for a state dereference in atomic self-refresh helpers - One compilation fix for c2p fbdev helpers Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20191107082215.GA34850@gilmour.lan
This commit is contained in:
commit
72d74a06e1
|
@ -1581,8 +1581,11 @@ static void commit_tail(struct drm_atomic_state *old_state)
|
||||||
{
|
{
|
||||||
struct drm_device *dev = old_state->dev;
|
struct drm_device *dev = old_state->dev;
|
||||||
const struct drm_mode_config_helper_funcs *funcs;
|
const struct drm_mode_config_helper_funcs *funcs;
|
||||||
|
struct drm_crtc_state *new_crtc_state;
|
||||||
|
struct drm_crtc *crtc;
|
||||||
ktime_t start;
|
ktime_t start;
|
||||||
s64 commit_time_ms;
|
s64 commit_time_ms;
|
||||||
|
unsigned int i, new_self_refresh_mask = 0;
|
||||||
|
|
||||||
funcs = dev->mode_config.helper_private;
|
funcs = dev->mode_config.helper_private;
|
||||||
|
|
||||||
|
@ -1602,6 +1605,15 @@ static void commit_tail(struct drm_atomic_state *old_state)
|
||||||
|
|
||||||
drm_atomic_helper_wait_for_dependencies(old_state);
|
drm_atomic_helper_wait_for_dependencies(old_state);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We cannot safely access new_crtc_state after
|
||||||
|
* drm_atomic_helper_commit_hw_done() so figure out which crtc's have
|
||||||
|
* self-refresh active beforehand:
|
||||||
|
*/
|
||||||
|
for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i)
|
||||||
|
if (new_crtc_state->self_refresh_active)
|
||||||
|
new_self_refresh_mask |= BIT(i);
|
||||||
|
|
||||||
if (funcs && funcs->atomic_commit_tail)
|
if (funcs && funcs->atomic_commit_tail)
|
||||||
funcs->atomic_commit_tail(old_state);
|
funcs->atomic_commit_tail(old_state);
|
||||||
else
|
else
|
||||||
|
@ -1610,7 +1622,8 @@ static void commit_tail(struct drm_atomic_state *old_state)
|
||||||
commit_time_ms = ktime_ms_delta(ktime_get(), start);
|
commit_time_ms = ktime_ms_delta(ktime_get(), start);
|
||||||
if (commit_time_ms > 0)
|
if (commit_time_ms > 0)
|
||||||
drm_self_refresh_helper_update_avg_times(old_state,
|
drm_self_refresh_helper_update_avg_times(old_state,
|
||||||
(unsigned long)commit_time_ms);
|
(unsigned long)commit_time_ms,
|
||||||
|
new_self_refresh_mask);
|
||||||
|
|
||||||
drm_atomic_helper_commit_cleanup_done(old_state);
|
drm_atomic_helper_commit_cleanup_done(old_state);
|
||||||
|
|
||||||
|
|
|
@ -133,29 +133,33 @@ static void drm_self_refresh_helper_entry_work(struct work_struct *work)
|
||||||
* drm_self_refresh_helper_update_avg_times - Updates a crtc's SR time averages
|
* drm_self_refresh_helper_update_avg_times - Updates a crtc's SR time averages
|
||||||
* @state: the state which has just been applied to hardware
|
* @state: the state which has just been applied to hardware
|
||||||
* @commit_time_ms: the amount of time in ms that this commit took to complete
|
* @commit_time_ms: the amount of time in ms that this commit took to complete
|
||||||
|
* @new_self_refresh_mask: bitmask of crtc's that have self_refresh_active in
|
||||||
|
* new state
|
||||||
*
|
*
|
||||||
* Called after &drm_mode_config_funcs.atomic_commit_tail, this function will
|
* Called after &drm_mode_config_funcs.atomic_commit_tail, this function will
|
||||||
* update the average entry/exit self refresh times on self refresh transitions.
|
* update the average entry/exit self refresh times on self refresh transitions.
|
||||||
* These averages will be used when calculating how long to delay before
|
* These averages will be used when calculating how long to delay before
|
||||||
* entering self refresh mode after activity.
|
* entering self refresh mode after activity.
|
||||||
*/
|
*/
|
||||||
void drm_self_refresh_helper_update_avg_times(struct drm_atomic_state *state,
|
void
|
||||||
unsigned int commit_time_ms)
|
drm_self_refresh_helper_update_avg_times(struct drm_atomic_state *state,
|
||||||
|
unsigned int commit_time_ms,
|
||||||
|
unsigned int new_self_refresh_mask)
|
||||||
{
|
{
|
||||||
struct drm_crtc *crtc;
|
struct drm_crtc *crtc;
|
||||||
struct drm_crtc_state *old_crtc_state, *new_crtc_state;
|
struct drm_crtc_state *old_crtc_state;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state,
|
for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) {
|
||||||
new_crtc_state, i) {
|
bool new_self_refresh_active = new_self_refresh_mask & BIT(i);
|
||||||
struct drm_self_refresh_data *sr_data = crtc->self_refresh_data;
|
struct drm_self_refresh_data *sr_data = crtc->self_refresh_data;
|
||||||
struct ewma_psr_time *time;
|
struct ewma_psr_time *time;
|
||||||
|
|
||||||
if (old_crtc_state->self_refresh_active ==
|
if (old_crtc_state->self_refresh_active ==
|
||||||
new_crtc_state->self_refresh_active)
|
new_self_refresh_active)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (new_crtc_state->self_refresh_active)
|
if (new_self_refresh_active)
|
||||||
time = &sr_data->entry_avg_ms;
|
time = &sr_data->entry_avg_ms;
|
||||||
else
|
else
|
||||||
time = &sr_data->exit_avg_ms;
|
time = &sr_data->exit_avg_ms;
|
||||||
|
|
|
@ -29,7 +29,7 @@ static inline void _transp(u32 d[], unsigned int i1, unsigned int i2,
|
||||||
|
|
||||||
extern void c2p_unsupported(void);
|
extern void c2p_unsupported(void);
|
||||||
|
|
||||||
static inline u32 get_mask(unsigned int n)
|
static __always_inline u32 get_mask(unsigned int n)
|
||||||
{
|
{
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -57,7 +57,7 @@ static inline u32 get_mask(unsigned int n)
|
||||||
* Transpose operations on 8 32-bit words
|
* Transpose operations on 8 32-bit words
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void transp8(u32 d[], unsigned int n, unsigned int m)
|
static __always_inline void transp8(u32 d[], unsigned int n, unsigned int m)
|
||||||
{
|
{
|
||||||
u32 mask = get_mask(n);
|
u32 mask = get_mask(n);
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ static inline void transp8(u32 d[], unsigned int n, unsigned int m)
|
||||||
* Transpose operations on 4 32-bit words
|
* Transpose operations on 4 32-bit words
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void transp4(u32 d[], unsigned int n, unsigned int m)
|
static __always_inline void transp4(u32 d[], unsigned int n, unsigned int m)
|
||||||
{
|
{
|
||||||
u32 mask = get_mask(n);
|
u32 mask = get_mask(n);
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ static inline void transp4(u32 d[], unsigned int n, unsigned int m)
|
||||||
* Transpose operations on 4 32-bit words (reverse order)
|
* Transpose operations on 4 32-bit words (reverse order)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void transp4x(u32 d[], unsigned int n, unsigned int m)
|
static __always_inline void transp4x(u32 d[], unsigned int n, unsigned int m)
|
||||||
{
|
{
|
||||||
u32 mask = get_mask(n);
|
u32 mask = get_mask(n);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,20 @@ struct drm_gem_shmem_object {
|
||||||
*/
|
*/
|
||||||
unsigned int pages_use_count;
|
unsigned int pages_use_count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @madv: State for madvise
|
||||||
|
*
|
||||||
|
* 0 is active/inuse.
|
||||||
|
* A negative value is the object is purged.
|
||||||
|
* Positive values are driver specific and not used by the helpers.
|
||||||
|
*/
|
||||||
int madv;
|
int madv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @madv_list: List entry for madvise tracking
|
||||||
|
*
|
||||||
|
* Typically used by drivers to track purgeable objects
|
||||||
|
*/
|
||||||
struct list_head madv_list;
|
struct list_head madv_list;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,7 +13,8 @@ struct drm_crtc;
|
||||||
|
|
||||||
void drm_self_refresh_helper_alter_state(struct drm_atomic_state *state);
|
void drm_self_refresh_helper_alter_state(struct drm_atomic_state *state);
|
||||||
void drm_self_refresh_helper_update_avg_times(struct drm_atomic_state *state,
|
void drm_self_refresh_helper_update_avg_times(struct drm_atomic_state *state,
|
||||||
unsigned int commit_time_ms);
|
unsigned int commit_time_ms,
|
||||||
|
unsigned int new_self_refresh_mask);
|
||||||
|
|
||||||
int drm_self_refresh_helper_init(struct drm_crtc *crtc);
|
int drm_self_refresh_helper_init(struct drm_crtc *crtc);
|
||||||
void drm_self_refresh_helper_cleanup(struct drm_crtc *crtc);
|
void drm_self_refresh_helper_cleanup(struct drm_crtc *crtc);
|
||||||
|
|
Loading…
Reference in New Issue