From 9654c776fda55d6420a14449bf2e274839c444a6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 11:47:57 +1000 Subject: drm/modesetting: add initial encoder structures and setup functions --- linux-core/drm_crtc.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index b769eb7a..7765afea 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -277,6 +277,7 @@ struct drm_property { struct drm_crtc; struct drm_output; +struct drm_encoder; /** * drm_crtc_funcs - control CRTCs for a given device @@ -396,9 +397,29 @@ struct drm_output_funcs { }; +struct drm_encoder_funcs { + void (*destroy)(struct drm_encoder *encoder); +}; + #define DRM_OUTPUT_MAX_UMODES 16 #define DRM_OUTPUT_MAX_PROPERTY 16 #define DRM_OUTPUT_LEN 32 + +/** + * drm_encoder - central DRM encoder structure + */ +struct drm_encoder { + struct drm_device *dev; + struct list_head head; + + int id; + int encoder_type; + uint32_t possible_crtcs; + uint32_t possible_clones; + + const struct drm_encoder_funcs *funcs; +}; + /** * drm_output - central DRM output control structure * @crtc: CRTC this output is currently connected to, NULL if none @@ -496,6 +517,8 @@ struct drm_mode_config { struct list_head fb_list; int num_output; struct list_head output_list; + int num_encoder; + struct list_head encoder_list; int num_crtc; struct list_head crtc_list; -- cgit v1.2.3 From 6b970f193b69a912183dcbf85b9dc51ec99aeefe Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 11:48:41 +1000 Subject: drm: remove unused init func from outputs --- linux-core/drm_crtc.h | 1 - 1 file changed, 1 deletion(-) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index 7765afea..7bb779ef 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -383,7 +383,6 @@ struct drm_crtc { * etc. */ struct drm_output_funcs { - void (*init)(struct drm_output *output); void (*dpms)(struct drm_output *output, int mode); void (*save)(struct drm_output *output); void (*restore)(struct drm_output *output); -- cgit v1.2.3 From 8ae82f3a2feb8b8fe56214c4c9e806bf1f87cbf8 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 12:03:36 +1000 Subject: drm: add encoder / get encoder to the modesetting resources interface --- linux-core/drm_crtc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index 7bb779ef..adaa49bd 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -366,7 +366,6 @@ struct drm_crtc { /** * drm_output_funcs - control outputs on a given device - * @init: setup this output * @dpms: set power state (see drm_crtc_funcs above) * @save: save output state * @restore: restore output state @@ -417,6 +416,7 @@ struct drm_encoder { uint32_t possible_clones; const struct drm_encoder_funcs *funcs; + void *helper_private; }; /** @@ -663,5 +663,7 @@ extern int drm_mode_hotplug_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int drm_mode_replacefb(struct drm_device *dev, void *data, struct drm_file *file_priv); +int drm_mode_getencoder(struct drm_device *dev, + void *data, struct drm_file *file_priv); #endif /* __DRM_CRTC_H__ */ -- cgit v1.2.3 From b72419a8f74bfb1d3b6a5ca1d8f6dfa3c6a84e86 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 12:19:13 +1000 Subject: drm: add encoder ids to the output handling --- linux-core/drm_crtc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index adaa49bd..ed8467e3 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -402,6 +402,7 @@ struct drm_encoder_funcs { #define DRM_OUTPUT_MAX_UMODES 16 #define DRM_OUTPUT_MAX_PROPERTY 16 #define DRM_OUTPUT_LEN 32 +#define DRM_OUTPUT_MAX_ENCODER 2 /** * drm_encoder - central DRM encoder structure @@ -468,6 +469,8 @@ struct drm_output { uint64_t property_values[DRM_OUTPUT_MAX_PROPERTY]; void *helper_private; + + u32 encoder_ids[DRM_OUTPUT_MAX_ENCODER]; }; /** -- cgit v1.2.3 From 9239cf511f65a43eb578fbb6a7c5255e05db2101 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 13:31:16 +1000 Subject: drm: add encoder attach/detach --- linux-core/drm_crtc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index ed8467e3..04e0d033 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -629,6 +629,11 @@ extern int drm_property_add_enum(struct drm_property *property, int index, extern bool drm_create_tv_properties(struct drm_device *dev, int num_formats, char *formats[]); +extern int drm_mode_output_attach_encoder(struct drm_output *output, + struct drm_encoder *encoder); +extern void drm_mode_output_detach_encoder(struct drm_output *output, + struct drm_encoder *encoder); + /* IOCTLs */ extern int drm_mode_getresources(struct drm_device *dev, void *data, struct drm_file *file_priv); -- cgit v1.2.3 From 6aeef92c0cad784a5019ea90d97ab81f4e51fdd9 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 13:57:27 +1000 Subject: drm: attach an encoder. Time to do some renaming on the connectors I think --- linux-core/drm_crtc.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index 04e0d033..03c336e2 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -556,12 +556,19 @@ extern void drm_crtc_init(struct drm_device *dev, const struct drm_crtc_funcs *funcs); extern void drm_crtc_cleanup(struct drm_crtc *crtc); -void drm_output_init(struct drm_device *dev, - struct drm_output *output, - const struct drm_output_funcs *funcs, - int output_type); +extern void drm_output_init(struct drm_device *dev, + struct drm_output *output, + const struct drm_output_funcs *funcs, + int output_type); -void drm_output_cleanup(struct drm_output *output); +extern void drm_output_cleanup(struct drm_output *output); + +extern void drm_encoder_init(struct drm_device *dev, + struct drm_encoder *encoder, + const struct drm_encoder_funcs *funcs, + int encoder_type); + +extern void drm_encoder_cleanup(struct drm_encoder *encoder); extern char *drm_get_output_name(struct drm_output *output); extern char *drm_get_dpms_name(int val); -- cgit v1.2.3 From 9d38448ed33aaff324cc4bbe1e0878593e97d07d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 15:03:12 +1000 Subject: modesetting: the great renaming. Okay we have crtc, encoder and connectors. No more outputs exposed beyond driver internals I've broken intel tv connector stuff. Really for TV we should have one TV connector, with a sub property for the type of signal been driven over it --- linux-core/drm_crtc.h | 200 +++++++++++++++++++++++++------------------------- 1 file changed, 99 insertions(+), 101 deletions(-) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index 03c336e2..568b6b31 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -17,10 +17,10 @@ struct drm_device; struct drm_mode_set; /* - * Note on terminology: here, for brevity and convenience, we refer to output - * control chips as 'CRTCs'. They can control any type of output, VGA, LVDS, + * Note on terminology: here, for brevity and convenience, we refer to connector + * control chips as 'CRTCs'. They can control any type of connector, VGA, LVDS, * DVI, etc. And 'screen' refers to the whole of the visible display, which - * may span multiple monitors (and therefore multiple CRTC and output + * may span multiple monitors (and therefore multiple CRTC and connector * structures). */ @@ -80,7 +80,7 @@ struct drm_display_mode { struct list_head head; char name[DRM_DISPLAY_MODE_LEN]; int mode_id; - int output_count; + int connector_count; enum drm_mode_status status; int type; @@ -149,24 +149,24 @@ struct drm_display_mode { #define DPMSModeSuspend 2 #define DPMSModeOff 3 -#define ConnectorUnknown 0 -#define ConnectorVGA 1 -#define ConnectorDVII 2 -#define ConnectorDVID 3 -#define ConnectorDVIA 4 -#define ConnectorComposite 5 -#define ConnectorSVIDEO 6 -#define ConnectorLVDS 7 -#define ConnectorComponent 8 -#define Connector9PinDIN 9 -#define ConnectorDisplayPort 10 -#define ConnectorHDMIA 11 -#define ConnectorHDMIB 12 - -enum drm_output_status { - output_status_connected = 1, - output_status_disconnected = 2, - output_status_unknown = 3, +#define DRM_MODE_CONNECTOR_Unknown 0 +#define DRM_MODE_CONNECTOR_VGA 1 +#define DRM_MODE_CONNECTOR_DVII 2 +#define DRM_MODE_CONNECTOR_DVID 3 +#define DRM_MODE_CONNECTOR_DVIA 4 +#define DRM_MODE_CONNECTOR_Composite 5 +#define DRM_MODE_CONNECTOR_SVIDEO 6 +#define DRM_MODE_CONNECTOR_LVDS 7 +#define DRM_MODE_CONNECTOR_Component 8 +#define DRM_MODE_CONNECTOR_9PinDIN 9 +#define DRM_MODE_CONNECTOR_DisplayPort 10 +#define DRM_MODE_CONNECTOR_HDMIA 11 +#define DRM_MODE_CONNECTOR_HDMIB 12 + +enum drm_connector_status { + connector_status_connected = 1, + connector_status_disconnected = 2, + connector_status_unknown = 3, }; enum subpixel_order { @@ -276,7 +276,7 @@ struct drm_property { }; struct drm_crtc; -struct drm_output; +struct drm_connector; struct drm_encoder; /** @@ -295,9 +295,9 @@ struct drm_encoder; * @destroy: deinit and free object. * * The drm_crtc_funcs structure is the central CRTC management structure - * in the DRM. Each CRTC controls one or more outputs (note that the name + * in the DRM. Each CRTC controls one or more connectors (note that the name * CRTC is simply historical, a CRTC may control LVDS, VGA, DVI, TV out, etc. - * outputs, not just CRTs). + * connectors, not just CRTs). * * Each driver is responsible for filling out this structure at startup time, * in addition to providing other modesetting features, like i2c and DDC @@ -339,7 +339,7 @@ struct drm_crtc_funcs { * @desired_y: desired y for desired_mode * @funcs: CRTC control functions * - * Each CRTC may have one or more outputs associated with it. This structure + * Each CRTC may have one or more connectors associated with it. This structure * allows the CRTC to be controlled. */ struct drm_crtc { @@ -348,7 +348,7 @@ struct drm_crtc { int id; /* idr assigned */ - /* framebuffer the output is currently bound to */ + /* framebuffer the connector is currently bound to */ struct drm_framebuffer *fb; bool enabled; @@ -365,32 +365,32 @@ struct drm_crtc { }; /** - * drm_output_funcs - control outputs on a given device + * drm_connector_funcs - control connectors on a given device * @dpms: set power state (see drm_crtc_funcs above) - * @save: save output state - * @restore: restore output state - * @mode_valid: is this mode valid on the given output? - * @mode_fixup: try to fixup proposed mode for this output + * @save: save connector state + * @restore: restore connector state + * @mode_valid: is this mode valid on the given connector? + * @mode_fixup: try to fixup proposed mode for this connector * @mode_set: set this mode - * @detect: is this output active? - * @get_modes: get mode list for this output - * @set_property: property for this output may need update + * @detect: is this connector active? + * @get_modes: get mode list for this connector + * @set_property: property for this connector may need update * @destroy: make object go away * - * Each CRTC may have one or more outputs attached to it. The functions - * below allow the core DRM code to control outputs, enumerate available modes, + * Each CRTC may have one or more connectors attached to it. The functions + * below allow the core DRM code to control connectors, enumerate available modes, * etc. */ -struct drm_output_funcs { - void (*dpms)(struct drm_output *output, int mode); - void (*save)(struct drm_output *output); - void (*restore)(struct drm_output *output); - enum drm_output_status (*detect)(struct drm_output *output); - int (*get_modes)(struct drm_output *output); - bool (*set_property)(struct drm_output *output, struct drm_property *property, +struct drm_connector_funcs { + void (*dpms)(struct drm_connector *connector, int mode); + void (*save)(struct drm_connector *connector); + void (*restore)(struct drm_connector *connector); + enum drm_connector_status (*detect)(struct drm_connector *connector); + int (*get_modes)(struct drm_connector *connector); + bool (*set_property)(struct drm_connector *connector, struct drm_property *property, uint64_t val); - void (*destroy)(struct drm_output *output); - int (*mode_valid)(struct drm_output *output, + void (*destroy)(struct drm_connector *connector); + int (*mode_valid)(struct drm_connector *connector, struct drm_display_mode *mode); }; @@ -399,10 +399,10 @@ struct drm_encoder_funcs { void (*destroy)(struct drm_encoder *encoder); }; -#define DRM_OUTPUT_MAX_UMODES 16 -#define DRM_OUTPUT_MAX_PROPERTY 16 -#define DRM_OUTPUT_LEN 32 -#define DRM_OUTPUT_MAX_ENCODER 2 +#define DRM_CONNECTOR_MAX_UMODES 16 +#define DRM_CONNECTOR_MAX_PROPERTY 16 +#define DRM_CONNECTOR_LEN 32 +#define DRM_CONNECTOR_MAX_ENCODER 2 /** * drm_encoder - central DRM encoder structure @@ -421,24 +421,24 @@ struct drm_encoder { }; /** - * drm_output - central DRM output control structure - * @crtc: CRTC this output is currently connected to, NULL if none - * @possible_crtcs: bitmap of CRTCS this output could be attached to - * @possible_clones: bitmap of possible outputs this output could clone - * @interlace_allowed: can this output handle interlaced modes? - * @doublescan_allowed: can this output handle doublescan? - * @available_modes: modes available on this output (from get_modes() + user) - * @initial_x: initial x position for this output - * @initial_y: initial y position for this output - * @status: output connected? - * @funcs: output control functions + * drm_connector - central DRM connector control structure + * @crtc: CRTC this connector is currently connected to, NULL if none + * @possible_crtcs: bitmap of CRTCS this connector could be attached to + * @possible_clones: bitmap of possible connectors this connector could clone + * @interlace_allowed: can this connector handle interlaced modes? + * @doublescan_allowed: can this connector handle doublescan? + * @available_modes: modes available on this connector (from get_modes() + user) + * @initial_x: initial x position for this connector + * @initial_y: initial y position for this connector + * @status: connector connected? + * @funcs: connector control functions * - * Each output may be connected to one or more CRTCs, or may be clonable by - * another output if they can share a CRTC. Each output also has a specific + * Each connector may be connected to one or more CRTCs, or may be clonable by + * another connector if they can share a CRTC. Each connector also has a specific * position in the broader display (referred to as a 'screen' though it could * span multiple monitors). */ -struct drm_output { +struct drm_connector { struct drm_device *dev; struct device kdev; struct device_attribute *attr; @@ -446,37 +446,37 @@ struct drm_output { struct drm_crtc *crtc; int id; /* idr assigned */ - int output_type; - int output_type_id; + int connector_type; + int connector_type_id; unsigned long possible_crtcs; unsigned long possible_clones; bool interlace_allowed; bool doublescan_allowed; - struct list_head modes; /* list of modes on this output */ + struct list_head modes; /* list of modes on this connector */ int initial_x, initial_y; - enum drm_output_status status; + enum drm_connector_status status; /* these are modes added by probing with DDC or the BIOS */ struct list_head probed_modes; struct drm_display_info display_info; - const struct drm_output_funcs *funcs; + const struct drm_connector_funcs *funcs; struct list_head user_modes; struct drm_property_blob *edid_blob_ptr; - u32 property_ids[DRM_OUTPUT_MAX_PROPERTY]; - uint64_t property_values[DRM_OUTPUT_MAX_PROPERTY]; + u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; + uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY]; void *helper_private; - u32 encoder_ids[DRM_OUTPUT_MAX_ENCODER]; + u32 encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; }; /** * struct drm_mode_set * - * Represents a single crtc the outputs that it drives with what mode + * Represents a single crtc the connectors that it drives with what mode * and from which framebuffer it scans out from. * * This is used to set modes. @@ -490,8 +490,8 @@ struct drm_mode_set uint32_t x; uint32_t y; - struct drm_output **outputs; - size_t num_outputs; + struct drm_connector **connectors; + size_t num_connectors; }; /** @@ -501,7 +501,7 @@ struct drm_mode_set * Currently only a resize hook is available. DRM will call back into the * driver with a new screen width and height. If the driver can't support * the proposed size, it can return false. Otherwise it should adjust - * the CRTC<->output mappings as needed and update its view of the screen. + * the CRTC<->connector mappings as needed and update its view of the screen. */ struct drm_mode_config_funcs { bool (*resize_fb)(struct drm_device *dev, struct drm_framebuffer *fb); @@ -513,12 +513,12 @@ struct drm_mode_config_funcs { */ struct drm_mode_config { struct mutex mutex; /* protects configuration and IDR */ - struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, output, modes - just makes life easier */ + struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */ /* this is limited to one for now */ int num_fb; struct list_head fb_list; - int num_output; - struct list_head output_list; + int num_connector; + struct list_head connector_list; int num_encoder; struct list_head encoder_list; @@ -536,8 +536,6 @@ struct drm_mode_config { struct list_head property_blob_list; struct drm_property *edid_property; struct drm_property *dpms_property; - struct drm_property *connector_type_property; - struct drm_property *connector_num_property; /* TV properties */ struct drm_property *tv_mode_property; @@ -556,12 +554,12 @@ extern void drm_crtc_init(struct drm_device *dev, const struct drm_crtc_funcs *funcs); extern void drm_crtc_cleanup(struct drm_crtc *crtc); -extern void drm_output_init(struct drm_device *dev, - struct drm_output *output, - const struct drm_output_funcs *funcs, - int output_type); +extern void drm_connector_init(struct drm_device *dev, + struct drm_connector *connector, + const struct drm_connector_funcs *funcs, + int connector_type); -extern void drm_output_cleanup(struct drm_output *output); +extern void drm_connector_cleanup(struct drm_connector *connector); extern void drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, @@ -570,15 +568,15 @@ extern void drm_encoder_init(struct drm_device *dev, extern void drm_encoder_cleanup(struct drm_encoder *encoder); -extern char *drm_get_output_name(struct drm_output *output); +extern char *drm_get_connector_name(struct drm_connector *connector); extern char *drm_get_dpms_name(int val); extern void drm_fb_release(struct file *filp); -extern struct edid *drm_get_edid(struct drm_output *output, +extern struct edid *drm_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter); -extern int drm_add_edid_modes(struct drm_output *output, struct edid *edid); -extern void drm_mode_probed_add(struct drm_output *output, struct drm_display_mode *mode); -extern void drm_mode_remove(struct drm_output *output, struct drm_display_mode *mode); +extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); +extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode); +extern void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode); extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev, struct drm_display_mode *mode); extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode); @@ -607,13 +605,13 @@ extern void drm_mode_sort(struct list_head *mode_list); extern int drm_mode_vrefresh(struct drm_display_mode *mode); extern void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags); -extern void drm_mode_output_list_update(struct drm_output *output); -extern int drm_mode_output_update_edid_property(struct drm_output *output, +extern void drm_mode_connector_list_update(struct drm_connector *connector); +extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, struct edid *edid); -extern int drm_output_property_set_value(struct drm_output *output, +extern int drm_connector_property_set_value(struct drm_connector *connector, struct drm_property *property, uint64_t value); -extern int drm_output_property_get_value(struct drm_output *output, +extern int drm_connector_property_get_value(struct drm_connector *connector, struct drm_property *property, uint64_t *value); extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev); @@ -623,10 +621,10 @@ extern struct drm_framebuffer *drm_framebuffer_create(struct drm_device *dev); extern void drm_framebuffer_destroy(struct drm_framebuffer *fb); extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc); extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); -extern void drm_crtc_probe_output_modes(struct drm_device *dev, int maxX, int maxY); +extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); extern bool drm_crtc_in_use(struct drm_crtc *crtc); -extern int drm_output_attach_property(struct drm_output *output, +extern int drm_connector_attach_property(struct drm_connector *connector, struct drm_property *property, uint64_t init_val); extern struct drm_property *drm_property_create(struct drm_device *dev, int flags, const char *name, int num_values); @@ -636,9 +634,9 @@ extern int drm_property_add_enum(struct drm_property *property, int index, extern bool drm_create_tv_properties(struct drm_device *dev, int num_formats, char *formats[]); -extern int drm_mode_output_attach_encoder(struct drm_output *output, +extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, struct drm_encoder *encoder); -extern void drm_mode_output_detach_encoder(struct drm_output *output, +extern void drm_mode_connector_detach_encoder(struct drm_connector *connector, struct drm_encoder *encoder); /* IOCTLs */ @@ -647,7 +645,7 @@ extern int drm_mode_getresources(struct drm_device *dev, extern int drm_mode_getcrtc(struct drm_device *dev, void *data, struct drm_file *file_priv); -extern int drm_mode_getoutput(struct drm_device *dev, +extern int drm_mode_getconnector(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int drm_mode_setcrtc(struct drm_device *dev, void *data, struct drm_file *file_priv); @@ -672,7 +670,7 @@ extern int drm_mode_getproperty_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int drm_mode_getblob_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); -extern int drm_mode_output_property_set_ioctl(struct drm_device *dev, +extern int drm_mode_connector_property_set_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int drm_mode_hotplug_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); -- cgit v1.2.3 From 5d47185eb69d73dd7e6ee3ddde4d0c7642c2d5b7 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 15:32:58 +1000 Subject: drm: switch possible crtc/clones over to encoders --- linux-core/drm_crtc.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index 568b6b31..09886c15 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -423,8 +423,6 @@ struct drm_encoder { /** * drm_connector - central DRM connector control structure * @crtc: CRTC this connector is currently connected to, NULL if none - * @possible_crtcs: bitmap of CRTCS this connector could be attached to - * @possible_clones: bitmap of possible connectors this connector could clone * @interlace_allowed: can this connector handle interlaced modes? * @doublescan_allowed: can this connector handle doublescan? * @available_modes: modes available on this connector (from get_modes() + user) @@ -448,8 +446,6 @@ struct drm_connector { int connector_type; int connector_type_id; - unsigned long possible_crtcs; - unsigned long possible_clones; bool interlace_allowed; bool doublescan_allowed; struct list_head modes; /* list of modes on this connector */ @@ -470,7 +466,9 @@ struct drm_connector { void *helper_private; - u32 encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; + uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; + uint32_t force_encoder_id; + uint32_t current_encoder_id; }; /** -- cgit v1.2.3 From e439e74776b215d70d8e34e8aa9cea22179dcbc6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Jun 2008 10:05:54 +1000 Subject: drm/modesetting: another re-org of some internals. Move dpms into the helper functions. Move crtc into the encoder. Move disable unused functions into the helper. --- linux-core/drm_crtc.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index 09886c15..14aa5038 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -304,12 +304,6 @@ struct drm_encoder; * bus accessors. */ struct drm_crtc_funcs { - /* - * Control power levels on the CRTC. If the mode passed in is - * unsupported, the provider must use the next lowest power level. - */ - void (*dpms)(struct drm_crtc *crtc, int mode); - /* Save CRTC state */ void (*save)(struct drm_crtc *crtc); /* suspend? */ /* Restore CRTC state */ @@ -416,6 +410,7 @@ struct drm_encoder { uint32_t possible_crtcs; uint32_t possible_clones; + struct drm_crtc *crtc; const struct drm_encoder_funcs *funcs; void *helper_private; }; @@ -441,7 +436,6 @@ struct drm_connector { struct device kdev; struct device_attribute *attr; struct list_head head; - struct drm_crtc *crtc; int id; /* idr assigned */ int connector_type; @@ -468,7 +462,7 @@ struct drm_connector { uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; uint32_t force_encoder_id; - uint32_t current_encoder_id; + struct drm_encoder *encoder; /* currently active encoder */ }; /** @@ -582,7 +576,6 @@ extern void drm_mode_config_init(struct drm_device *dev); extern void drm_mode_config_cleanup(struct drm_device *dev); extern void drm_mode_set_name(struct drm_display_mode *mode); extern bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2); -extern void drm_disable_unused_functions(struct drm_device *dev); /* for us by fb module */ extern int drm_mode_attachmode_crtc(struct drm_device *dev, @@ -631,6 +624,7 @@ extern int drm_property_add_enum(struct drm_property *property, int index, uint64_t value, const char *name); extern bool drm_create_tv_properties(struct drm_device *dev, int num_formats, char *formats[]); +extern char *drm_get_encoder_name(struct drm_encoder *encoder); extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, struct drm_encoder *encoder); -- cgit v1.2.3 From 0dd000b578adec6ff101c957bce7dc9a32b76713 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Jun 2008 11:12:28 +1000 Subject: drm/modesetting: move some connector functions to helper. Migrated the output mode collection into the helper. --- linux-core/drm_crtc.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index 14aa5038..6dbc88a4 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -380,13 +380,10 @@ struct drm_connector_funcs { void (*save)(struct drm_connector *connector); void (*restore)(struct drm_connector *connector); enum drm_connector_status (*detect)(struct drm_connector *connector); - int (*get_modes)(struct drm_connector *connector); + void (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height); bool (*set_property)(struct drm_connector *connector, struct drm_property *property, uint64_t val); void (*destroy)(struct drm_connector *connector); - int (*mode_valid)(struct drm_connector *connector, - struct drm_display_mode *mode); - }; struct drm_encoder_funcs { -- cgit v1.2.3 From 46c78a2223802b9105a87b7125fd4872ab69c4ca Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Jun 2008 11:44:35 +1000 Subject: drm/modesetting: add best encoder finding for modesetting This asks the driver to suggest the best encoder for the connector during the pick crtcs stage. Need to also do this during mode setting stages --- linux-core/drm_crtc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/drm_crtc.h') diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index 6dbc88a4..390ab2d3 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -624,7 +624,7 @@ extern bool drm_create_tv_properties(struct drm_device *dev, int num_formats, extern char *drm_get_encoder_name(struct drm_encoder *encoder); extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, - struct drm_encoder *encoder); + struct drm_encoder *encoder); extern void drm_mode_connector_detach_encoder(struct drm_connector *connector, struct drm_encoder *encoder); -- cgit v1.2.3