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

DRAFT: drm: rp1: rp1-vec: Add a parameter to set DRM picture aspect ratio #6166

Closed
Closed
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
10 changes: 9 additions & 1 deletion drivers/gpu/drm/rp1/rp1-vec/rp1_vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ module_param_named(cmode, rp1vec_cmode_str, charp, 0600);
MODULE_PARM_DESC(cmode, "Custom video mode:\n"
"\t\t<pclk>,<hact>,<hfp>,<hsync>,<hbp>,<vact>,<vfp>,<vsync>,<vbp>[,i]\n");

int par;
module_param_named(par, par, int, 0600);
MODULE_PARM_DESC(par, "Picture Aspect Ratio for DRM modes:\n"
"\t\t0 => Unspecified; 1 => 4:3; 2 => 16:9\n");

static struct drm_display_mode *rp1vec_parse_custom_mode(struct drm_device *dev)
{
char const *p = rp1vec_cmode_str;
Expand Down Expand Up @@ -101,6 +106,7 @@ static struct drm_display_mode *rp1vec_parse_custom_mode(struct drm_device *dev)
mode->flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC;
if (strchr(p, 'i'))
mode->flags |= DRM_MODE_FLAG_INTERLACE;
mode->picture_aspect_ratio = par;

return mode;
}
Expand Down Expand Up @@ -362,11 +368,13 @@ static int rp1vec_connector_get_modes(struct drm_connector *connector)
} else if (mode->hdisplay == 704 && mode->vtotal == preferred_lines) {
mode->type |= DRM_MODE_TYPE_PREFERRED;
}
mode->picture_aspect_ratio = par;
drm_mode_set_name(mode);

drm_mode_probed_add(connector, mode);
n++;

if (mode->vtotal == 405 || mode->vtotal == 819)
if (i >= 4)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 4 is creeping in as a magic number both here and line 355. It'd be nice if it came from a define in and around the rp1vec_modes array.

break; /* Don't offer progressive for Systems A, E */
}
}
Expand Down