https://github.com/torvalds/linux
Revision bb74fc1bf3072bd3ab4ed5f43afd287a63baf2d7 authored by Mario Kleiner on 12 February 2016, 19:30:30 UTC, committed by Dave Airlie on 17 February 2016, 04:19:00 UTC
drm_vblank_offdelay can have three different types of values:

< 0 is to be always treated the same as dev->vblank_disable_immediate
= 0 is to be treated as "never disable vblanks"
> 0 is to be treated as disable immediate if kms driver wants it
    that way via dev->vblank_disable_immediate. Otherwise it is
    a disable timeout in msecs.

This got broken in Linux 3.18+ for the implementation of
drm_vblank_on. If the user specified a value of zero which should
always reenable vblank irqs in this function, a kms driver could
override the users choice by setting vblank_disable_immediate
to true. This patch fixes the regression and keeps the user in
control.

v2: Only reenable vblank if there are clients left or the user
    requested to "never disable vblanks" via offdelay 0. Enabling
    vblanks even in the "delayed disable" case (offdelay > 0) was
    specifically added by Ville in commit cd19e52aee922
    ("drm: Kick start vblank interrupts at drm_vblank_on()"),
    but after discussion it turns out that this was done by accident.

    Citing Ville: "I think it just ended up as a mess due to changing
    some of the semantics of offdelay<0 vs. offdelay==0 vs.
    disable_immediate during the review of the series. So yeah, given
    how drm_vblank_put() works now, I'd just make this check for
    offdelay==0."

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Cc: <stable@vger.kernel.org> # 3.18+
Cc: michel@daenzer.net
Cc: vbabka@suse.cz
Cc: ville.syrjala@linux.intel.com
Cc: daniel.vetter@ffwll.ch
Cc: dri-devel@lists.freedesktop.org
Cc: alexander.deucher@amd.com
Cc: christian.koenig@amd.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent c61934e
History
Tip revision: bb74fc1bf3072bd3ab4ed5f43afd287a63baf2d7 authored by Mario Kleiner on 12 February 2016, 19:30:30 UTC
drm: Fix treatment of drm_vblank_offdelay in drm_vblank_on() (v2)
Tip revision: bb74fc1
File Mode Size
netfilter
Kconfig -rw-r--r-- 23.7 KB
Makefile -rw-r--r-- 2.5 KB
af_inet.c -rw-r--r-- 44.7 KB
ah4.c -rw-r--r-- 13.5 KB
arp.c -rw-r--r-- 34.4 KB
cipso_ipv4.c -rw-r--r-- 62.8 KB
datagram.c -rw-r--r-- 3.2 KB
devinet.c -rw-r--r-- 59.0 KB
esp4.c -rw-r--r-- 17.3 KB
fib_frontend.c -rw-r--r-- 30.8 KB
fib_lookup.h -rw-r--r-- 1.3 KB
fib_rules.c -rw-r--r-- 8.2 KB
fib_semantics.c -rw-r--r-- 37.4 KB
fib_trie.c -rw-r--r-- 64.0 KB
fou.c -rw-r--r-- 20.9 KB
gre_demux.c -rw-r--r-- 2.8 KB
gre_offload.c -rw-r--r-- 6.2 KB
icmp.c -rw-r--r-- 29.1 KB
igmp.c -rw-r--r-- 70.6 KB
inet_connection_sock.c -rw-r--r-- 26.7 KB
inet_diag.c -rw-r--r-- 27.6 KB
inet_fragment.c -rw-r--r-- 10.3 KB
inet_hashtables.c -rw-r--r-- 17.1 KB
inet_lro.c -rw-r--r-- 9.3 KB
inet_timewait_sock.c -rw-r--r-- 9.0 KB
inetpeer.c -rw-r--r-- 15.9 KB
ip_forward.c -rw-r--r-- 3.9 KB
ip_fragment.c -rw-r--r-- 21.2 KB
ip_gre.c -rw-r--r-- 33.5 KB
ip_input.c -rw-r--r-- 13.5 KB
ip_options.c -rw-r--r-- 15.3 KB
ip_output.c -rw-r--r-- 39.6 KB
ip_sockglue.c -rw-r--r-- 35.0 KB
ip_tunnel.c -rw-r--r-- 27.9 KB
ip_tunnel_core.c -rw-r--r-- 11.5 KB
ip_vti.c -rw-r--r-- 14.0 KB
ipcomp.c -rw-r--r-- 4.6 KB
ipconfig.c -rw-r--r-- 39.7 KB
ipip.c -rw-r--r-- 15.1 KB
ipmr.c -rw-r--r-- 66.3 KB
netfilter.c -rw-r--r-- 5.2 KB
ping.c -rw-r--r-- 29.2 KB
proc.c -rw-r--r-- 20.3 KB
protocol.c -rw-r--r-- 2.3 KB
raw.c -rw-r--r-- 25.5 KB
route.c -rw-r--r-- 69.1 KB
syncookies.c -rw-r--r-- 11.5 KB
sysctl_net_ipv4.c -rw-r--r-- 24.4 KB
tcp.c -rw-r--r-- 83.3 KB
tcp_bic.c -rw-r--r-- 6.2 KB
tcp_cdg.c -rw-r--r-- 11.1 KB
tcp_cong.c -rw-r--r-- 10.9 KB
tcp_cubic.c -rw-r--r-- 14.7 KB
tcp_dctcp.c -rw-r--r-- 9.4 KB
tcp_diag.c -rw-r--r-- 2.4 KB
tcp_fastopen.c -rw-r--r-- 8.8 KB
tcp_highspeed.c -rw-r--r-- 4.8 KB
tcp_htcp.c -rw-r--r-- 7.4 KB
tcp_hybla.c -rw-r--r-- 4.9 KB
tcp_illinois.c -rw-r--r-- 8.2 KB
tcp_input.c -rw-r--r-- 179.4 KB
tcp_ipv4.c -rw-r--r-- 61.2 KB
tcp_lp.c -rw-r--r-- 8.7 KB
tcp_metrics.c -rw-r--r-- 30.4 KB
tcp_minisocks.c -rw-r--r-- 26.0 KB
tcp_offload.c -rw-r--r-- 7.6 KB
tcp_output.c -rw-r--r-- 101.3 KB
tcp_probe.c -rw-r--r-- 7.4 KB
tcp_recovery.c -rw-r--r-- 3.5 KB
tcp_scalable.c -rw-r--r-- 1.4 KB
tcp_timer.c -rw-r--r-- 18.7 KB
tcp_vegas.c -rw-r--r-- 9.6 KB
tcp_vegas.h -rw-r--r-- 889 bytes
tcp_veno.c -rw-r--r-- 5.6 KB
tcp_westwood.c -rw-r--r-- 8.2 KB
tcp_yeah.c -rw-r--r-- 6.9 KB
tunnel4.c -rw-r--r-- 4.1 KB
udp.c -rw-r--r-- 67.0 KB
udp_diag.c -rw-r--r-- 5.5 KB
udp_impl.h -rw-r--r-- 1.2 KB
udp_offload.c -rw-r--r-- 11.3 KB
udp_tunnel.c -rw-r--r-- 3.1 KB
udplite.c -rw-r--r-- 3.4 KB
xfrm4_input.c -rw-r--r-- 3.9 KB
xfrm4_mode_beet.c -rw-r--r-- 3.7 KB
xfrm4_mode_transport.c -rw-r--r-- 2.1 KB
xfrm4_mode_tunnel.c -rw-r--r-- 3.0 KB
xfrm4_output.c -rw-r--r-- 2.6 KB
xfrm4_policy.c -rw-r--r-- 8.6 KB
xfrm4_protocol.c -rw-r--r-- 6.7 KB
xfrm4_state.c -rw-r--r-- 2.4 KB
xfrm4_tunnel.c -rw-r--r-- 2.7 KB

back to top