[PATCH 7/7] drm/fsl-dcu: use mode flags for hsync/vsync pixelclk polarity

Stefan Agner stefan at agner.ch
Wed Feb 3 23:30:59 UTC 2016


On 2016-02-03 06:04, Thierry Reding wrote:
> On Wed, Jan 27, 2016 at 06:46:50PM -0800, Stefan Agner wrote:
> [...]
>> On 2015-11-18 18:42, Stefan Agner wrote:
> [...]
>> > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> [...]
>> > @@ -89,6 +91,15 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct
>> > drm_crtc *crtc)
>> >  	vfp = mode->vsync_start - mode->vdisplay;
>> >  	vsw = mode->vsync_end - mode->vsync_start;
>> >
>> > +	if (!(mode->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE))
>> > +		pol |= DCU_SYN_POL_INV_PXCK_FALL;
>> > +
>> > +	if (mode->flags & DRM_MODE_FLAG_NHSYNC)
>> > +		pol |= DCU_SYN_POL_INV_HS_LOW;
>> > +
>> > +	if (mode->flags & DRM_MODE_FLAG_NHSYNC)
>> > +		pol |= DCU_SYN_POL_INV_VS_LOW;
> 
> I suspect that you want to check for DRM_MODE_FLAG_NVSYNC here instead.
> 

Ups, yes.

>> > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
>> > b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
>> > index 6413ac9..2a724f3 100644
>> > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
>> > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
>> > @@ -47,8 +47,8 @@
>> >  #define DCU_VSYN_PARA_FP(x)		(x)
>> >
>> >  #define DCU_SYN_POL			0x0024
>> > -#define DCU_SYN_POL_INV_PXCK_FALL	(0 << 6)
>> > -#define DCU_SYN_POL_NEG_REMAIN		(0 << 5)
>> > +#define DCU_SYN_POL_INV_PXCK_FALL	BIT(6)
>> > +#define DCU_SYN_POL_NEG_REMAIN		BIT(5)
> 
> I don't understand these changes. You're in fact changing the values for
> these defines, but it's not mentioned in the commit message. It also
> seems like it should be a separate patch because it isn't related to the
> mode flags changes in the remainder of the patch.

Yes, in order to set them, I need them to be positive, there is no use
if they are zero... They haven't been used at all so far, so there is no
issue in changing their value. Just realized that their naming is
actually related to the 0 value, so I probably should rename them to
just reflect the field name

#define DCU_SYN_POL_INV_PXCK	BIT(6)
#define DCU_SYN_POL_NEG		BIT(5)

--
Stefan


More information about the dri-devel mailing list