Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VC4: Add a module parameter for the screen resolution #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion drivers/gpu/drm/vc4/vc4_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;

Expand Down Expand Up @@ -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)");
5 changes: 5 additions & 0 deletions drivers/gpu/drm/vc4/vc4_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down