diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-04-17 02:43:32 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-04-28 00:56:23 -0400 |
commit | 1794d257fa7bab3ea5162f8abdca749996b65343 (patch) | |
tree | ea8d035a218a0cb0ee83443b3c25bd8df25567e2 /include/drm | |
parent | bbb0aef5cfe95fe9b51a7eeba4a440b69037b01f (diff) |
drm: Export the command-line mode parser
In the absence of configuration data for providing the fixed mode for
a panel, I would like to be able to pass such modes along a separate
module paramenter. To do so, I then need to parse a modeline from a
string, which drm is already capable of. Export that capability to the
drivers.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drmP.h | 25 | ||||
-rw-r--r-- | include/drm/drm_fb_helper.h | 16 |
2 files changed, 26 insertions, 15 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4ab866e73f46..738b3a5faa12 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -994,6 +994,22 @@ struct drm_minor { | |||
994 | struct drm_mode_group mode_group; | 994 | struct drm_mode_group mode_group; |
995 | }; | 995 | }; |
996 | 996 | ||
997 | /* mode specified on the command line */ | ||
998 | struct drm_cmdline_mode { | ||
999 | bool specified; | ||
1000 | bool refresh_specified; | ||
1001 | bool bpp_specified; | ||
1002 | int xres, yres; | ||
1003 | int bpp; | ||
1004 | int refresh; | ||
1005 | bool rb; | ||
1006 | bool interlace; | ||
1007 | bool cvt; | ||
1008 | bool margins; | ||
1009 | enum drm_connector_force force; | ||
1010 | }; | ||
1011 | |||
1012 | |||
997 | struct drm_pending_vblank_event { | 1013 | struct drm_pending_vblank_event { |
998 | struct drm_pending_event base; | 1014 | struct drm_pending_event base; |
999 | int pipe; | 1015 | int pipe; |
@@ -1389,6 +1405,15 @@ extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, | |||
1389 | struct drm_crtc *refcrtc); | 1405 | struct drm_crtc *refcrtc); |
1390 | extern void drm_calc_timestamping_constants(struct drm_crtc *crtc); | 1406 | extern void drm_calc_timestamping_constants(struct drm_crtc *crtc); |
1391 | 1407 | ||
1408 | extern bool | ||
1409 | drm_mode_parse_command_line_for_connector(const char *mode_option, | ||
1410 | struct drm_connector *connector, | ||
1411 | struct drm_cmdline_mode *mode); | ||
1412 | |||
1413 | extern struct drm_display_mode * | ||
1414 | drm_mode_create_from_cmdline_mode(struct drm_device *dev, | ||
1415 | struct drm_cmdline_mode *cmd); | ||
1416 | |||
1392 | /* Modesetting support */ | 1417 | /* Modesetting support */ |
1393 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); | 1418 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); |
1394 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); | 1419 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); |
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index c99c3d3e7811..6e3076ad646e 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
@@ -40,20 +40,6 @@ struct drm_fb_helper_crtc { | |||
40 | struct drm_display_mode *desired_mode; | 40 | struct drm_display_mode *desired_mode; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | /* mode specified on the command line */ | ||
44 | struct drm_fb_helper_cmdline_mode { | ||
45 | bool specified; | ||
46 | bool refresh_specified; | ||
47 | bool bpp_specified; | ||
48 | int xres, yres; | ||
49 | int bpp; | ||
50 | int refresh; | ||
51 | bool rb; | ||
52 | bool interlace; | ||
53 | bool cvt; | ||
54 | bool margins; | ||
55 | }; | ||
56 | |||
57 | struct drm_fb_helper_surface_size { | 43 | struct drm_fb_helper_surface_size { |
58 | u32 fb_width; | 44 | u32 fb_width; |
59 | u32 fb_height; | 45 | u32 fb_height; |
@@ -74,8 +60,8 @@ struct drm_fb_helper_funcs { | |||
74 | }; | 60 | }; |
75 | 61 | ||
76 | struct drm_fb_helper_connector { | 62 | struct drm_fb_helper_connector { |
77 | struct drm_fb_helper_cmdline_mode cmdline_mode; | ||
78 | struct drm_connector *connector; | 63 | struct drm_connector *connector; |
64 | struct drm_cmdline_mode cmdline_mode; | ||
79 | }; | 65 | }; |
80 | 66 | ||
81 | struct drm_fb_helper { | 67 | struct drm_fb_helper { |