Revert "drm: Initialize struct drm_crtc_state.no_vblank from device settings"

This reverts commit 2a8bb9dce7.

It breaks the Android kernel api and was added only because of a tiny
drm driver bugfix for an issue that can not ever really be hit, so it is
safe to revert.

Bug: 161946584
Change-Id: Iaf1a6bca2d36fef1626157fd165a224b011cdcca
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2023-03-22 08:07:59 +00:00
parent af8848e0d9
commit aac98e0c73
5 changed files with 10 additions and 70 deletions

View File

@ -589,7 +589,6 @@ mode_valid(struct drm_atomic_state *state)
* &drm_crtc_state.connectors_changed is set when a connector is added or
* removed from the crtc. &drm_crtc_state.active_changed is set when
* &drm_crtc_state.active changes, which is used for DPMS.
* &drm_crtc_state.no_vblank is set from the result of drm_dev_has_vblank().
* See also: drm_atomic_crtc_needs_modeset()
*
* IMPORTANT:
@ -656,11 +655,6 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
return -EINVAL;
}
if (drm_dev_has_vblank(dev))
new_crtc_state->no_vblank = false;
else
new_crtc_state->no_vblank = true;
}
ret = handle_conflicting_encoders(state, false);
@ -2211,9 +2205,7 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_dependencies);
* when a job is queued, and any change to the pipeline that does not touch the
* connector is leading to timeouts when calling
* drm_atomic_helper_wait_for_vblanks() or
* drm_atomic_helper_wait_for_flip_done(). In addition to writeback
* connectors, this function can also fake VBLANK events for CRTCs without
* VBLANK interrupt.
* drm_atomic_helper_wait_for_flip_done().
*
* This is part of the atomic helper support for nonblocking commits, see
* drm_atomic_helper_setup_commit() for an overview.

View File

@ -69,12 +69,6 @@
* &drm_driver.max_vblank_count. In that case the vblank core only disables the
* vblanks after a timer has expired, which can be configured through the
* ``vblankoffdelay`` module parameter.
*
* Drivers for hardware without support for vertical-blanking interrupts
* must not call drm_vblank_init(). For such drivers, atomic helpers will
* automatically generate fake vblank events as part of the display update.
* This functionality also can be controlled by the driver by enabling and
* disabling struct drm_crtc_state.no_vblank.
*/
/* Retry timestamp calculation up to 3 times to satisfy
@ -494,28 +488,6 @@ err:
}
EXPORT_SYMBOL(drm_vblank_init);
/**
* drm_dev_has_vblank - test if vblanking has been initialized for
* a device
* @dev: the device
*
* Drivers may call this function to test if vblank support is
* initialized for a device. For most hardware this means that vblanking
* can also be enabled.
*
* Atomic helpers use this function to initialize
* &drm_crtc_state.no_vblank. See also drm_atomic_helper_check_modeset().
*
* Returns:
* True if vblanking has been initialized for the given device, false
* otherwise.
*/
bool drm_dev_has_vblank(const struct drm_device *dev)
{
return dev->num_crtcs != 0;
}
EXPORT_SYMBOL(drm_dev_has_vblank);
/**
* drm_crtc_vblank_waitqueue - get vblank waitqueue for the CRTC
* @crtc: which CRTC's vblank waitqueue to retrieve

View File

@ -175,25 +175,12 @@ struct drm_crtc_state {
* @no_vblank:
*
* Reflects the ability of a CRTC to send VBLANK events. This state
* usually depends on the pipeline configuration. If set to true, DRM
* atomic helpers will send out a fake VBLANK event during display
* updates after all hardware changes have been committed. This is
* implemented in drm_atomic_helper_fake_vblank().
*
* One usage is for drivers and/or hardware without support for VBLANK
* interrupts. Such drivers typically do not initialize vblanking
* (i.e., call drm_vblank_init() with the number of CRTCs). For CRTCs
* without initialized vblanking, this field is set to true in
* drm_atomic_helper_check_modeset(), and a fake VBLANK event will be
* send out on each update of the display pipeline by
* drm_atomic_helper_fake_vblank().
*
* Another usage is CRTCs feeding a writeback connector operating in
* oneshot mode. In this case the fake VBLANK event is only generated
* when a job is queued to the writeback connector, and we want the
* core to fake VBLANK events when this part of the pipeline hasn't
* changed but others had or when the CRTC and connectors are being
* disabled.
* usually depends on the pipeline configuration, and the main usuage
* is CRTCs feeding a writeback connector operating in oneshot mode.
* In this case the VBLANK event is only generated when a job is queued
* to the writeback connector, and we want the core to fake VBLANK
* events when this part of the pipeline hasn't changed but others had
* or when the CRTC and connectors are being disabled.
*
* __drm_atomic_helper_crtc_duplicate_state() will not reset the value
* from the current state, the CRTC driver is then responsible for
@ -349,14 +336,7 @@ struct drm_crtc_state {
* - Events for disabled CRTCs are not allowed, and drivers can ignore
* that case.
*
* For very simple hardware without VBLANK interrupt, enabling
* &struct drm_crtc_state.no_vblank makes DRM's atomic commit helpers
* send a fake VBLANK event at the end of the display update after all
* hardware changes have been applied. See
* drm_atomic_helper_fake_vblank().
*
* For more complex hardware this
* can be handled by the drm_crtc_send_vblank_event() function,
* This can be handled by the drm_crtc_send_vblank_event() function,
* which the driver should call on the provided event upon completion of
* the atomic commit. Note that if the driver supports vblank signalling
* and timestamping the vblank counters and timestamps must agree with

View File

@ -100,11 +100,8 @@ struct drm_simple_display_pipe_funcs {
* This is the function drivers should submit the
* &drm_pending_vblank_event from. Using either
* drm_crtc_arm_vblank_event(), when the driver supports vblank
* interrupt handling, or drm_crtc_send_vblank_event() for more
* complex case. In case the hardware lacks vblank support entirely,
* drivers can set &struct drm_crtc_state.no_vblank in
* &struct drm_simple_display_pipe_funcs.check and let DRM's
* atomic helper fake a vblank event.
* interrupt handling, or drm_crtc_send_vblank_event() directly in case
* the hardware lacks vblank support entirely.
*/
void (*update)(struct drm_simple_display_pipe *pipe,
struct drm_plane_state *old_plane_state);

View File

@ -195,7 +195,6 @@ struct drm_vblank_crtc {
};
int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
bool drm_dev_has_vblank(const struct drm_device *dev);
u64 drm_crtc_vblank_count(struct drm_crtc *crtc);
u64 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
ktime_t *vblanktime);