summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-05-30 13:31:16 +1000
committerDave Airlie <airlied@redhat.com>2008-05-30 13:31:16 +1000
commit9239cf511f65a43eb578fbb6a7c5255e05db2101 (patch)
treea4e8e65249a96f6547642677a83101a32c1311d8
parent4403c59b76c55c9c430decac8bc76e4230a253ab (diff)
drm: add encoder attach/detach
-rw-r--r--linux-core/drm_crtc.c28
-rw-r--r--linux-core/drm_crtc.h5
2 files changed, 33 insertions, 0 deletions
diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c
index f6937f44..400df98e 100644
--- a/linux-core/drm_crtc.c
+++ b/linux-core/drm_crtc.c
@@ -2202,3 +2202,31 @@ out:
return ret;
}
+
+int drm_mode_output_attach_encoder(struct drm_output *output,
+ struct drm_encoder *encoder)
+{
+ int i;
+
+ for (i = 0; i < DRM_OUTPUT_MAX_ENCODER; i++) {
+ if (output->encoder_ids[i] == 0) {
+ output->encoder_ids[i] = encoder->id;
+ return 0;
+ }
+ }
+ return -ENOMEM;
+}
+EXPORT_SYMBOL(drm_mode_output_attach_encoder);
+
+void drm_mode_output_detach_encoder(struct drm_output *output,
+ struct drm_encoder *encoder)
+{
+ int i;
+ for (i = 0; i < DRM_OUTPUT_MAX_ENCODER; i++) {
+ if (output->encoder_ids[i] == encoder->id) {
+ output->encoder_ids[i] = 0;
+ break;
+ }
+ }
+}
+EXPORT_SYMBOL(drm_mode_output_detach_encoder);
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);