From f0fe8e5318bb37f4b41ee6396471cde09a5c7a98 Mon Sep 17 00:00:00 2001 From: Gottfried Haider Date: Tue, 10 Feb 2015 17:59:00 +0100 Subject: [PATCH] VC4: Add a module parameter for the screen resolution Signed-off-by: Gottfried Haider --- drivers/gpu/drm/vc4/vc4_display.c | 14 +++++++++++++- drivers/gpu/drm/vc4/vc4_display.h | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_display.c b/drivers/gpu/drm/vc4/vc4_display.c index 0c067b99c2ff83..3ca80f002fa9f2 100644 --- a/drivers/gpu/drm/vc4/vc4_display.c +++ b/drivers/gpu/drm/vc4/vc4_display.c @@ -81,6 +81,11 @@ vc4_connector_best_encoder(struct drm_connector *connector) return vc4_attached_encoder(connector); } +static struct vc4_params params = { + .width = 1680, + .height = 1050 +}; + static int vc4_connector_get_modes(struct drm_connector *connector) { @@ -90,7 +95,8 @@ vc4_connector_get_modes(struct drm_connector *connector) /* XXX This is the resolution that the firmware is * detecting for the monitor on my desk. */ - mode = drm_gtf_mode(dev, 1680, 1050, 60, false, false); + mode = drm_gtf_mode(dev, params.width, params.height, 60, false, false); + DRM_INFO("Using resolution %dx%d@60\n", params.width, params.height); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; @@ -417,3 +423,9 @@ vc4_modeset_init(struct drm_device *dev) return 0; } + +module_param_named(width, params.width, int, 0444); +MODULE_PARM_DESC(width, "Display width (default 1680)"); + +module_param_named(height, params.height, int, 0444); +MODULE_PARM_DESC(height, "Display height (default 1050)"); diff --git a/drivers/gpu/drm/vc4/vc4_display.h b/drivers/gpu/drm/vc4/vc4_display.h index 5addffc8d0d6ac..69b59161c345ab 100644 --- a/drivers/gpu/drm/vc4/vc4_display.h +++ b/drivers/gpu/drm/vc4/vc4_display.h @@ -36,6 +36,11 @@ struct vc4_crtc { struct drm_crtc base; }; +struct vc4_params { + int width; + int height; +}; + #define to_vc4_crtc(x) container_of(x, struct vc4_crtc, base) #define to_vc4_connector(x) container_of(x, struct vc4_connector, base) #define to_vc4_encoder(x) container_of(x, struct vc4_encoder, base)