Re: [Intel-gfx] [PATCH 05/15] drm/i915/tv: Store the TV oversampling factor in the TV mode
On Mon, Nov 12, 2018 at 06:59:49PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä > > Store the oversampling factor as a number in the TV modes. We > shall want to arithmetic with this which is easier if it's > a number we can use directly. > > Signed-off-by: Ville Syrjälä Reviewed-by: Imre Deak > --- > drivers/gpu/drm/i915/intel_tv.c | 42 ++--- > 1 file changed, 28 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c > index dea24ef88763..96257b29d07c 100644 > --- a/drivers/gpu/drm/i915/intel_tv.c > +++ b/drivers/gpu/drm/i915/intel_tv.c > @@ -307,7 +307,7 @@ struct tv_mode { > > u32 clock; > u16 refresh; /* in millihertz (for precision) */ > - u32 oversample; > + u8 oversample; > u8 hsync_end; > u16 hblank_start, hblank_end, htotal; > bool progressive : 1, trilevel_sync : 1, component_only : 1; > @@ -379,7 +379,7 @@ static const struct tv_mode tv_modes[] = { > .name = "NTSC-M", > .clock = 108000, > .refresh= 59940, > - .oversample = TV_OVERSAMPLE_8X, > + .oversample = 8, > .component_only = 0, > /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */ > > @@ -422,7 +422,7 @@ static const struct tv_mode tv_modes[] = { > .name = "NTSC-443", > .clock = 108000, > .refresh= 59940, > - .oversample = TV_OVERSAMPLE_8X, > + .oversample = 8, > .component_only = 0, > /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 4.43MHz */ > .hsync_end = 64, .hblank_end = 124, > @@ -464,7 +464,7 @@ static const struct tv_mode tv_modes[] = { > .name = "NTSC-J", > .clock = 108000, > .refresh= 59940, > - .oversample = TV_OVERSAMPLE_8X, > + .oversample = 8, > .component_only = 0, > > /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */ > @@ -507,7 +507,7 @@ static const struct tv_mode tv_modes[] = { > .name = "PAL-M", > .clock = 108000, > .refresh= 59940, > - .oversample = TV_OVERSAMPLE_8X, > + .oversample = 8, > .component_only = 0, > > /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */ > @@ -551,7 +551,7 @@ static const struct tv_mode tv_modes[] = { > .name = "PAL-N", > .clock = 108000, > .refresh= 5, > - .oversample = TV_OVERSAMPLE_8X, > + .oversample = 8, > .component_only = 0, > > .hsync_end = 64, .hblank_end = 128, > @@ -596,7 +596,7 @@ static const struct tv_mode tv_modes[] = { > .name = "PAL", > .clock = 108000, > .refresh= 5, > - .oversample = TV_OVERSAMPLE_8X, > + .oversample = 8, > .component_only = 0, > > .hsync_end = 64, .hblank_end = 142, > @@ -638,7 +638,7 @@ static const struct tv_mode tv_modes[] = { > .name = "480p", > .clock = 108000, > .refresh= 59940, > - .oversample = TV_OVERSAMPLE_4X, > + .oversample = 4, > .component_only = 1, > > .hsync_end = 64, .hblank_end = 122, > @@ -662,7 +662,7 @@ static const struct tv_mode tv_modes[] = { > .name = "576p", > .clock = 108000, > .refresh= 5, > - .oversample = TV_OVERSAMPLE_4X, > + .oversample = 4, > .component_only = 1, > > .hsync_end = 64, .hblank_end = 139, > @@ -686,7 +686,7 @@ static const struct tv_mode tv_modes[] = { > .name = "720p@60Hz", > .clock = 148500, > .refresh= 6, > - .oversample = TV_OVERSAMPLE_2X, > + .oversample = 2, > .component_only = 1, > > .hsync_end = 80, .hblank_end = 300, > @@ -710,7 +710,7 @@ static const struct tv_mode tv_modes[] = { > .name = "720p@50Hz", > .clock = 148500, > .refresh= 5, > - .oversample = TV_OVERSAMPLE_2X, > + .oversample = 2, > .component_only = 1, > > .hsync_end = 80, .hblank_en
[Intel-gfx] [PATCH 05/15] drm/i915/tv: Store the TV oversampling factor in the TV mode
From: Ville Syrjälä Store the oversampling factor as a number in the TV modes. We shall want to arithmetic with this which is easier if it's a number we can use directly. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_tv.c | 42 ++--- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index dea24ef88763..96257b29d07c 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -307,7 +307,7 @@ struct tv_mode { u32 clock; u16 refresh; /* in millihertz (for precision) */ - u32 oversample; + u8 oversample; u8 hsync_end; u16 hblank_start, hblank_end, htotal; bool progressive : 1, trilevel_sync : 1, component_only : 1; @@ -379,7 +379,7 @@ static const struct tv_mode tv_modes[] = { .name = "NTSC-M", .clock = 108000, .refresh= 59940, - .oversample = TV_OVERSAMPLE_8X, + .oversample = 8, .component_only = 0, /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */ @@ -422,7 +422,7 @@ static const struct tv_mode tv_modes[] = { .name = "NTSC-443", .clock = 108000, .refresh= 59940, - .oversample = TV_OVERSAMPLE_8X, + .oversample = 8, .component_only = 0, /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 4.43MHz */ .hsync_end = 64, .hblank_end = 124, @@ -464,7 +464,7 @@ static const struct tv_mode tv_modes[] = { .name = "NTSC-J", .clock = 108000, .refresh= 59940, - .oversample = TV_OVERSAMPLE_8X, + .oversample = 8, .component_only = 0, /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */ @@ -507,7 +507,7 @@ static const struct tv_mode tv_modes[] = { .name = "PAL-M", .clock = 108000, .refresh= 59940, - .oversample = TV_OVERSAMPLE_8X, + .oversample = 8, .component_only = 0, /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */ @@ -551,7 +551,7 @@ static const struct tv_mode tv_modes[] = { .name = "PAL-N", .clock = 108000, .refresh= 5, - .oversample = TV_OVERSAMPLE_8X, + .oversample = 8, .component_only = 0, .hsync_end = 64, .hblank_end = 128, @@ -596,7 +596,7 @@ static const struct tv_mode tv_modes[] = { .name = "PAL", .clock = 108000, .refresh= 5, - .oversample = TV_OVERSAMPLE_8X, + .oversample = 8, .component_only = 0, .hsync_end = 64, .hblank_end = 142, @@ -638,7 +638,7 @@ static const struct tv_mode tv_modes[] = { .name = "480p", .clock = 108000, .refresh= 59940, - .oversample = TV_OVERSAMPLE_4X, + .oversample = 4, .component_only = 1, .hsync_end = 64, .hblank_end = 122, @@ -662,7 +662,7 @@ static const struct tv_mode tv_modes[] = { .name = "576p", .clock = 108000, .refresh= 5, - .oversample = TV_OVERSAMPLE_4X, + .oversample = 4, .component_only = 1, .hsync_end = 64, .hblank_end = 139, @@ -686,7 +686,7 @@ static const struct tv_mode tv_modes[] = { .name = "720p@60Hz", .clock = 148500, .refresh= 6, - .oversample = TV_OVERSAMPLE_2X, + .oversample = 2, .component_only = 1, .hsync_end = 80, .hblank_end = 300, @@ -710,7 +710,7 @@ static const struct tv_mode tv_modes[] = { .name = "720p@50Hz", .clock = 148500, .refresh= 5, - .oversample = TV_OVERSAMPLE_2X, + .oversample = 2, .component_only = 1, .hsync_end = 80, .hblank_end = 300, @@ -735,7 +735,7 @@ static const struct tv_mode tv_modes[] = { .name = "1080i@50Hz", .clock = 148