diff options
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_crtc.c')
| -rw-r--r-- | drivers/gpu/drm/vc4/vc4_crtc.c | 14 | 
1 files changed, 10 insertions, 4 deletions
| diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 783890e8d43a..59b20c8f132b 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -70,6 +70,7 @@ static const struct debugfs_reg32 crtc_regs[] = {  static unsigned int  vc4_crtc_get_cob_allocation(struct vc4_dev *vc4, unsigned int channel)  { +	struct vc4_hvs *hvs = vc4->hvs;  	u32 dispbase = HVS_READ(SCALER_DISPBASEX(channel));  	/* Top/base are supposed to be 4-pixel aligned, but the  	 * Raspberry Pi firmware fills the low bits (which are @@ -89,6 +90,7 @@ static bool vc4_crtc_get_scanout_position(struct drm_crtc *crtc,  {  	struct drm_device *dev = crtc->dev;  	struct vc4_dev *vc4 = to_vc4_dev(dev); +	struct vc4_hvs *hvs = vc4->hvs;  	struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);  	struct vc4_crtc_state *vc4_crtc_state = to_vc4_crtc_state(crtc->state);  	unsigned int cob_size; @@ -123,7 +125,7 @@ static bool vc4_crtc_get_scanout_position(struct drm_crtc *crtc,  		*vpos /= 2;  		/* Use hpos to correct for field offset in interlaced mode. */ -		if (VC4_GET_FIELD(val, SCALER_DISPSTATX_FRAME_COUNT) % 2) +		if (vc4_hvs_get_fifo_frame_count(hvs, vc4_crtc_state->assigned_channel) % 2)  			*hpos += mode->crtc_htotal / 2;  	} @@ -413,6 +415,7 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode  static void require_hvs_enabled(struct drm_device *dev)  {  	struct vc4_dev *vc4 = to_vc4_dev(dev); +	struct vc4_hvs *hvs = vc4->hvs;  	WARN_ON_ONCE((HVS_READ(SCALER_DISPCTRL) & SCALER_DISPCTRL_ENABLE) !=  		     SCALER_DISPCTRL_ENABLE); @@ -426,6 +429,7 @@ static int vc4_crtc_disable(struct drm_crtc *crtc,  	struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);  	struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);  	struct drm_device *dev = crtc->dev; +	struct vc4_dev *vc4 = to_vc4_dev(dev);  	int ret;  	CRTC_WRITE(PV_V_CONTROL, @@ -455,7 +459,7 @@ static int vc4_crtc_disable(struct drm_crtc *crtc,  		vc4_encoder->post_crtc_disable(encoder, state);  	vc4_crtc_pixelvalve_reset(crtc); -	vc4_hvs_stop_channel(dev, channel); +	vc4_hvs_stop_channel(vc4->hvs, channel);  	if (vc4_encoder && vc4_encoder->post_crtc_powerdown)  		vc4_encoder->post_crtc_powerdown(encoder, state); @@ -481,6 +485,7 @@ static struct drm_encoder *vc4_crtc_get_encoder_by_type(struct drm_crtc *crtc,  int vc4_crtc_disable_at_boot(struct drm_crtc *crtc)  {  	struct drm_device *drm = crtc->dev; +	struct vc4_dev *vc4 = to_vc4_dev(drm);  	struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);  	enum vc4_encoder_type encoder_type;  	const struct vc4_pv_data *pv_data; @@ -502,7 +507,7 @@ int vc4_crtc_disable_at_boot(struct drm_crtc *crtc)  	if (!(CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_VIDEN))  		return 0; -	channel = vc4_hvs_get_fifo_from_output(drm, vc4_crtc->data->hvs_output); +	channel = vc4_hvs_get_fifo_from_output(vc4->hvs, vc4_crtc->data->hvs_output);  	if (channel < 0)  		return 0; @@ -717,6 +722,7 @@ static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc)  	struct drm_crtc *crtc = &vc4_crtc->base;  	struct drm_device *dev = crtc->dev;  	struct vc4_dev *vc4 = to_vc4_dev(dev); +	struct vc4_hvs *hvs = vc4->hvs;  	u32 chan = vc4_crtc->current_hvs_channel;  	unsigned long flags; @@ -735,7 +741,7 @@ static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc)  		 * the CRTC and encoder already reconfigured, leading to  		 * underruns. This can be seen when reconfiguring the CRTC.  		 */ -		vc4_hvs_unmask_underrun(dev, chan); +		vc4_hvs_unmask_underrun(hvs, chan);  	}  	spin_unlock(&vc4_crtc->irq_lock);  	spin_unlock_irqrestore(&dev->event_lock, flags); | 
