Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/atmel-hlcdc: Use crtc->mode_valid() callback

Now that we have a callback to check if crtc supports a given mode
we can use it in atmel-hlcdc so that we restrict the number of probbed
modes to the ones we can actually display.

Also, remove the mode_fixup() callback as this is no longer needed
because mode_valid() will be called before.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Link: http://patchwork.freedesktop.org/patch/msgid/95fd6c06c58bd0b957e36a8d7068e6a74b581304.1495720737.git.joabreu@synopsys.com

authored by

Jose Abreu and committed by
Boris Brezillon
a57bf53e 991dca01

+11 -9
+5 -5
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
··· 140 140 cfg); 141 141 } 142 142 143 - static bool atmel_hlcdc_crtc_mode_fixup(struct drm_crtc *c, 144 - const struct drm_display_mode *mode, 145 - struct drm_display_mode *adjusted_mode) 143 + static enum drm_mode_status 144 + atmel_hlcdc_crtc_mode_valid(struct drm_crtc *c, 145 + const struct drm_display_mode *mode) 146 146 { 147 147 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); 148 148 149 - return atmel_hlcdc_dc_mode_valid(crtc->dc, adjusted_mode) == MODE_OK; 149 + return atmel_hlcdc_dc_mode_valid(crtc->dc, mode); 150 150 } 151 151 152 152 static void atmel_hlcdc_crtc_disable(struct drm_crtc *c) ··· 315 315 } 316 316 317 317 static const struct drm_crtc_helper_funcs lcdc_crtc_helper_funcs = { 318 - .mode_fixup = atmel_hlcdc_crtc_mode_fixup, 318 + .mode_valid = atmel_hlcdc_crtc_mode_valid, 319 319 .mode_set = drm_helper_crtc_mode_set, 320 320 .mode_set_nofb = atmel_hlcdc_crtc_mode_set_nofb, 321 321 .mode_set_base = drm_helper_crtc_mode_set_base,
+3 -2
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
··· 375 375 }; 376 376 MODULE_DEVICE_TABLE(of, atmel_hlcdc_of_match); 377 377 378 - int atmel_hlcdc_dc_mode_valid(struct atmel_hlcdc_dc *dc, 379 - struct drm_display_mode *mode) 378 + enum drm_mode_status 379 + atmel_hlcdc_dc_mode_valid(struct atmel_hlcdc_dc *dc, 380 + const struct drm_display_mode *mode) 380 381 { 381 382 int vfront_porch = mode->vsync_start - mode->vdisplay; 382 383 int vback_porch = mode->vtotal - mode->vsync_end;
+3 -2
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h
··· 422 422 layer->regmap = regmap; 423 423 } 424 424 425 - int atmel_hlcdc_dc_mode_valid(struct atmel_hlcdc_dc *dc, 426 - struct drm_display_mode *mode); 425 + enum drm_mode_status 426 + atmel_hlcdc_dc_mode_valid(struct atmel_hlcdc_dc *dc, 427 + const struct drm_display_mode *mode); 427 428 428 429 int atmel_hlcdc_create_planes(struct drm_device *dev); 429 430 void atmel_hlcdc_plane_irq(struct atmel_hlcdc_plane *plane);