summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/drm_crtc.c77
-rw-r--r--linux-core/drm_crtc.h3
-rw-r--r--linux-core/intel_crt.c4
-rw-r--r--linux-core/intel_tv.c2
4 files changed, 31 insertions, 55 deletions
diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c
index b6e636e0..aab936c2 100644
--- a/linux-core/drm_crtc.c
+++ b/linux-core/drm_crtc.c
@@ -43,10 +43,10 @@ struct drm_prop_enum_list {
* Global properties
*/
static struct drm_prop_enum_list drm_dpms_enum_list[] =
-{ { DPMSModeOn, "On" },
- { DPMSModeStandby, "Standby" },
- { DPMSModeSuspend, "Suspend" },
- { DPMSModeOff, "Off" }
+{ { DPMSModeOn, "On" },
+ { DPMSModeStandby, "Standby" },
+ { DPMSModeSuspend, "Suspend" },
+ { DPMSModeOff, "Off" }
};
char *drm_get_dpms_name(int val)
@@ -61,26 +61,26 @@ char *drm_get_dpms_name(int val)
}
static struct drm_prop_enum_list drm_connector_enum_list[] =
-{ { DRM_MODE_CONNECTOR_Unknown, "Unknown" },
- { DRM_MODE_CONNECTOR_VGA, "VGA" },
- { DRM_MODE_CONNECTOR_DVII, "DVI-I" },
- { DRM_MODE_CONNECTOR_DVID, "DVI-D" },
- { DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
- { DRM_MODE_CONNECTOR_Composite, "Composite" },
- { DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO" },
- { DRM_MODE_CONNECTOR_LVDS, "LVDS" },
- { DRM_MODE_CONNECTOR_Component, "Component" },
- { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN" },
- { DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort" },
- { DRM_MODE_CONNECTOR_HDMIA, "HDMI Type A" },
- { DRM_MODE_CONNECTOR_HDMIB, "HDMI Type B" },
+{ { DRM_MODE_CONNECTOR_Unknown, "Unknown" },
+ { DRM_MODE_CONNECTOR_VGA, "VGA" },
+ { DRM_MODE_CONNECTOR_DVII, "DVI-I" },
+ { DRM_MODE_CONNECTOR_DVID, "DVI-D" },
+ { DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
+ { DRM_MODE_CONNECTOR_Composite, "Composite" },
+ { DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO" },
+ { DRM_MODE_CONNECTOR_LVDS, "LVDS" },
+ { DRM_MODE_CONNECTOR_Component, "Component" },
+ { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN" },
+ { DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort" },
+ { DRM_MODE_CONNECTOR_HDMIA, "HDMI Type A" },
+ { DRM_MODE_CONNECTOR_HDMIB, "HDMI Type B" },
};
static struct drm_prop_enum_list drm_encoder_enum_list[] =
-{ { DRM_MODE_ENCODER_NONE, "None" },
- { DRM_MODE_ENCODER_DAC, "DAC" },
- { DRM_MODE_ENCODER_TMDS, "TMDS" },
- { DRM_MODE_ENCODER_LVDS, "LVDS" },
- { DRM_MODE_ENCODER_TVDAC, "TV" },
+{ { DRM_MODE_ENCODER_NONE, "None" },
+ { DRM_MODE_ENCODER_DAC, "DAC" },
+ { DRM_MODE_ENCODER_TMDS, "TMDS" },
+ { DRM_MODE_ENCODER_LVDS, "LVDS" },
+ { DRM_MODE_ENCODER_TVDAC, "TV" },
};
char *drm_get_encoder_name(struct drm_encoder *encoder)
@@ -164,7 +164,7 @@ static void drm_mode_object_put(struct drm_device *dev, struct drm_mode_object *
static void *drm_mode_object_find(struct drm_device *dev, uint32_t id, uint32_t type)
{
struct drm_mode_object *obj;
-
+
obj = idr_find(&dev->mode_config.crtc_idr, id);
if (!obj || (obj->type != type) || (obj->id != id))
return NULL;
@@ -369,6 +369,8 @@ void drm_connector_init(struct drm_device *dev,
drm_connector_attach_property(connector, dev->mode_config.edid_property, 0);
+ drm_connector_attach_property(connector, dev->mode_config.dpms_property, 0);
+
mutex_unlock(&dev->mode_config.mutex);
}
EXPORT_SYMBOL(drm_connector_init);
@@ -477,6 +479,8 @@ EXPORT_SYMBOL(drm_mode_destroy);
static int drm_mode_create_standard_connector_properties(struct drm_device *dev)
{
+ int i;
+
/*
* Standard properties (apply to all connectors)
*/
@@ -484,24 +488,6 @@ static int drm_mode_create_standard_connector_properties(struct drm_device *dev)
drm_property_create(dev, DRM_MODE_PROP_BLOB | DRM_MODE_PROP_IMMUTABLE,
"EDID", 0);
- return 0;
-}
-
-/**
- * drm_mode_create_dpms_property - create dpms connector property
- * @dev: DRM device
- *
- * Called by a driver wanting to support the dpms property.
- * Caller is responsible for attaching it to the appropriate connector.
- */
-bool drm_mode_create_dpms_property(struct drm_device *dev)
-{
- int i;
-
- /* already allocated */
- if (dev->mode_config.dpms_property)
- return 0;
-
dev->mode_config.dpms_property =
drm_property_create(dev, DRM_MODE_PROP_ENUM,
"DPMS", ARRAY_SIZE(drm_dpms_enum_list));
@@ -510,7 +496,6 @@ bool drm_mode_create_dpms_property(struct drm_device *dev)
return 0;
}
-EXPORT_SYMBOL(drm_mode_create_dpms_property);
/**
* drm_create_tv_properties - create TV specific connector properties
@@ -523,15 +508,11 @@ EXPORT_SYMBOL(drm_mode_create_dpms_property);
* responsible for allocating a list of format names and passing them to
* this routine.
*/
-bool drm_mode_create_tv_properties(struct drm_device *dev, int num_modes,
+bool drm_create_tv_properties(struct drm_device *dev, int num_modes,
char *modes[])
{
int i;
- /* already allocated */
- if (dev->mode_config.tv_mode_property)
- return 0;
-
dev->mode_config.tv_left_margin_property =
drm_property_create(dev, DRM_MODE_PROP_RANGE |
DRM_MODE_PROP_IMMUTABLE,
@@ -566,7 +547,7 @@ bool drm_mode_create_tv_properties(struct drm_device *dev, int num_modes,
return 0;
}
-EXPORT_SYMBOL(drm_mode_create_tv_properties);
+EXPORT_SYMBOL(drm_create_tv_properties);
/**
* drm_mode_config_init - initialize DRM mode_configuration structure
diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h
index b94e91a1..d6fa4cca 100644
--- a/linux-core/drm_crtc.h
+++ b/linux-core/drm_crtc.h
@@ -677,8 +677,7 @@ extern struct drm_property *drm_property_create(struct drm_device *dev, int flag
extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
extern int drm_property_add_enum(struct drm_property *property, int index,
uint64_t value, const char *name);
-extern bool drm_mode_create_dpms_property(struct drm_device *dev);
-extern bool drm_mode_create_tv_properties(struct drm_device *dev, int num_formats,
+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);
diff --git a/linux-core/intel_crt.c b/linux-core/intel_crt.c
index c7509d5e..b9e8ee63 100644
--- a/linux-core/intel_crt.c
+++ b/linux-core/intel_crt.c
@@ -292,9 +292,5 @@ void intel_crt_init(struct drm_device *dev)
drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs);
drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
- /* create dpms property */
- drm_mode_create_dpms_property(dev);
- drm_connector_attach_property(connector, dev->mode_config.dpms_property, 0);
-
drm_sysfs_connector_add(connector);
}
diff --git a/linux-core/intel_tv.c b/linux-core/intel_tv.c
index f564fa91..39f33d6c 100644
--- a/linux-core/intel_tv.c
+++ b/linux-core/intel_tv.c
@@ -1713,7 +1713,7 @@ intel_tv_init(struct drm_device *dev)
goto out;
for (i = 0; i < NUM_TV_MODES; i++)
tv_format_names[i] = tv_modes[i].name;
- drm_mode_create_tv_properties(dev, NUM_TV_MODES, tv_format_names);
+ drm_create_tv_properties(dev, NUM_TV_MODES, tv_format_names);
drm_connector_attach_property(connector, dev->mode_config.tv_mode_property,
initial_mode);