drm/arm: malidp: Use crtc->mode_valid() callback

Now that we have a callback to check if crtc supports a given mode
we can use it in malidp 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>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@linux.ie>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Liviu Dudau <liviu@dudau.co.uk>
This commit is contained in:
Jose Abreu 2017-05-19 01:52:17 +01:00 committed by Liviu Dudau
parent 925344ccc9
commit e2113c0367
1 changed files with 5 additions and 6 deletions

View File

@ -22,9 +22,8 @@
#include "malidp_drv.h" #include "malidp_drv.h"
#include "malidp_hw.h" #include "malidp_hw.h"
static bool malidp_crtc_mode_fixup(struct drm_crtc *crtc, static enum drm_mode_status malidp_crtc_mode_valid(struct drm_crtc *crtc,
const struct drm_display_mode *mode, const struct drm_display_mode *mode)
struct drm_display_mode *adjusted_mode)
{ {
struct malidp_drm *malidp = crtc_to_malidp_device(crtc); struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
struct malidp_hw_device *hwdev = malidp->dev; struct malidp_hw_device *hwdev = malidp->dev;
@ -40,11 +39,11 @@ static bool malidp_crtc_mode_fixup(struct drm_crtc *crtc,
if (rate != req_rate) { if (rate != req_rate) {
DRM_DEBUG_DRIVER("pxlclk doesn't support %ld Hz\n", DRM_DEBUG_DRIVER("pxlclk doesn't support %ld Hz\n",
req_rate); req_rate);
return false; return MODE_NOCLOCK;
} }
} }
return true; return MODE_OK;
} }
static void malidp_crtc_enable(struct drm_crtc *crtc) static void malidp_crtc_enable(struct drm_crtc *crtc)
@ -408,7 +407,7 @@ static int malidp_crtc_atomic_check(struct drm_crtc *crtc,
} }
static const struct drm_crtc_helper_funcs malidp_crtc_helper_funcs = { static const struct drm_crtc_helper_funcs malidp_crtc_helper_funcs = {
.mode_fixup = malidp_crtc_mode_fixup, .mode_valid = malidp_crtc_mode_valid,
.enable = malidp_crtc_enable, .enable = malidp_crtc_enable,
.disable = malidp_crtc_disable, .disable = malidp_crtc_disable,
.atomic_check = malidp_crtc_atomic_check, .atomic_check = malidp_crtc_atomic_check,