summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-22 12:34:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-22 12:34:52 +0100
commit99f8d68d3dbc54fdd7de4a6df546cfa89422a0c2 (patch)
tree5a0f9a5b6cbe234e7d4ea8ab0ca372faf6751082
parent4ba27e1f2198fc10a1dd268ed9f137bac6e80086 (diff)
display: Refactor is_panel()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/intel_display.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/intel_display.c b/src/intel_display.c
index ffcdb739..74ce7362 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -658,6 +658,13 @@ intel_crtc_init(ScrnInfoPtr scrn, struct intel_mode *mode, int num)
list_add(&intel_crtc->link, &mode->crtcs);
}
+static Bool
+is_panel(int type)
+{
+ return (type == DRM_MODE_CONNECTOR_LVDS ||
+ type == DRM_MODE_CONNECTOR_eDP);
+}
+
static xf86OutputStatus
intel_output_detect(xf86OutputPtr output)
{
@@ -823,8 +830,7 @@ intel_output_get_modes(xf86OutputPtr output)
* If it is incorrect, please fix me.
*/
intel_output->has_panel_limits = FALSE;
- if (koutput->connector_type == DRM_MODE_CONNECTOR_LVDS ||
- koutput->connector_type == DRM_MODE_CONNECTOR_eDP) {
+ if (is_panel(koutput->connector_type)) {
for (i = 0; i < koutput->count_modes; i++) {
drmModeModeInfo *mode_ptr;
@@ -1293,8 +1299,7 @@ intel_output_init(ScrnInfoPtr scrn, struct intel_mode *mode, int num)
output->subpixel_order = subpixel_conv_table[koutput->subpixel];
output->driver_private = intel_output;
- if (koutput->connector_type == DRM_MODE_CONNECTOR_LVDS ||
- koutput->connector_type == DRM_MODE_CONNECTOR_eDP)
+ if (is_panel(koutput->connector_type))
intel_output_backlight_init(output);
output->possible_crtcs = kencoder->possible_crtcs;