diff options
author | Jesse Barnes <jbarnes@hobbes.virtuousgeek.org> | 2007-04-07 19:22:39 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@hobbes.virtuousgeek.org> | 2007-04-07 19:22:39 -0700 |
commit | a35ba455b27b72f1ee3e1136ca6659f672ada4fa (patch) | |
tree | 7448660d48bbbb9e794e857963259ff599468daa | |
parent | 1c9ba24c2f37ca78965f8aa57ece02ef5bdb9b06 (diff) |
make drmP.h include drm_crtc.h for CRTC related stuff.
fixup drm_crtc.c so it matches VGA and other outputs properly.
make drm_crtc.c less verbose.
add function declarations in drm_crtc.h for other files.
-rw-r--r-- | linux-core/drmP.h | 1 | ||||
-rw-r--r-- | linux-core/drm_crtc.c | 37 | ||||
-rw-r--r-- | linux-core/drm_crtc.h | 29 |
3 files changed, 42 insertions, 25 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h index db62ab83..74f52854 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -75,6 +75,7 @@ #include <linux/poll.h> #include <asm/pgalloc.h> #include "drm.h" +#include "drm_crtc.h" #include <linux/slab.h> #define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c index 8e03dd5f..fe27e386 100644 --- a/linux-core/drm_crtc.c +++ b/linux-core/drm_crtc.c @@ -340,8 +340,6 @@ void drm_disable_unused_functions(struct drm_device *dev) */ void drm_mode_probed_add(struct drm_output *output, struct drm_display_mode *mode) { - printk(KERN_ERR "adding DDC mode %s to output %s\n", mode->name, - output->name); spin_lock(&output->modes_lock); list_add(&mode->head, &output->probed_modes); spin_unlock(&output->modes_lock); @@ -440,7 +438,6 @@ EXPORT_SYMBOL(drm_output_rename); struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev) { - int ret; struct drm_display_mode *nmode; nmode = kzalloc(sizeof(struct drm_display_mode), GFP_KERNEL); @@ -506,7 +503,8 @@ EXPORT_SYMBOL(drm_framebuffer_set_object); bool drm_initial_config(drm_device_t *dev, bool can_grow) { /* do a hardcoded initial configuration here */ - struct drm_crtc *crtc, *vga_crtc = NULL, *dvi_crtc = NULL; + struct drm_crtc *crtc, *vga_crtc = NULL, *dvi_crtc = NULL, + *lvds_crtc = NULL;; struct drm_framebuffer *fb; struct drm_output *output, *use_output = NULL; @@ -523,14 +521,18 @@ bool drm_initial_config(drm_device_t *dev, bool can_grow) /* bind both CRTCs to this fb */ /* only initialise one crtc to enabled state */ list_for_each_entry(crtc, &dev->crtc_config.crtc_list, head) { - DRM_DEBUG("crtc is %d\n", crtc->id); crtc->fb = fb; if (!vga_crtc) { vga_crtc = crtc; crtc->enabled = 1; crtc->desired_x = 0; crtc->desired_y = 0; - } + } else if (!lvds_crtc) { + lvds_crtc = crtc; + crtc->enabled = 1; + crtc->desired_x = 0; + crtc->desired_y = 0; + } #if 0 else if (!dvi_crtc) { dvi_crtc = crtc; @@ -549,29 +551,32 @@ bool drm_initial_config(drm_device_t *dev, bool can_grow) list_for_each_entry(output, &dev->crtc_config.output_list, head) { struct drm_display_mode *des_mode; - if (strncmp(output->name, "VGA", 3)) { - output->crtc = vga_crtc; - /* just pull the first mode out of that hat */ - list_for_each_entry(des_mode, &output->modes, head) + /* Get the first preferred moded */ + list_for_each_entry(des_mode, &output->modes, head) { + if (des_mode->flags & DRM_MODE_TYPE_PREFERRED) break; - DRM_DEBUG("Setting desired mode for output %s\n", output->name); + } + if (!strncmp(output->name, "VGA", 3)) { + output->crtc = vga_crtc; drm_mode_debug_printmodeline(dev, des_mode); output->crtc->desired_mode = des_mode; output->initial_x = 0; output->initial_y = 0; use_output = output; - } else if (strncmp(output->name, "TMDS", 4)) { + } else if (!strncmp(output->name, "TMDS", 4)) { output->crtc = vga_crtc; #if 0 - /* just pull the first mode out of that hat */ - list_for_each_entry(des_mode, &output->modes, head) - break; - DRM_DEBUG("Setting desired mode for output %s\n", output->name); drm_mode_debug_printmodeline(dev, des_mode); output->crtc->desired_mode = des_mode; #endif output->initial_x = 0; output->initial_y = 0; + } else if (!strncmp(output->name, "LVDS", 3)) { + output->crtc = lvds_crtc; + drm_mode_debug_printmodeline(dev, des_mode); + output->crtc->desired_mode = des_mode; + output->initial_x = 0; + output->initial_y = 0; } else output->crtc = NULL; diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h index a2c552e6..21908f0c 100644 --- a/linux-core/drm_crtc.h +++ b/linux-core/drm_crtc.h @@ -10,8 +10,6 @@ #include <linux/spinlock.h> #include <linux/types.h> #include <linux/idr.h> -#include "drmP.h" -#include "drm.h" struct drm_device; @@ -79,7 +77,7 @@ enum drm_mode_status { .hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \ .htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \ .vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \ - .vscan = (vs), .flags = (f) + .vscan = (vs), .flags = (f), .vrefresh = 0 struct drm_display_mode { /* Header */ @@ -128,7 +126,7 @@ struct drm_display_mode { int private_flags; int vrefresh; - float hsync;//, vrefresh; + float hsync; }; /* Video mode flags */ @@ -417,13 +415,13 @@ struct drm_crtc_config { struct drm_output *drm_output_create(struct drm_device *dev, const struct drm_output_funcs *funcs, const char *name); -void drm_output_destroy(struct drm_output *output); -bool drm_output_rename(struct drm_output *output, const char *name); +extern void drm_output_destroy(struct drm_output *output); +extern bool drm_output_rename(struct drm_output *output, const char *name); -int drm_add_edid_modes(struct drm_output *output, +extern int drm_add_edid_modes(struct drm_output *output, struct i2c_adapter *adapter); -void drm_mode_probed_add(struct drm_output *output, struct drm_display_mode *mode); -void drm_mode_remove(struct drm_output *output, struct drm_display_mode *mode); +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 struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev, struct drm_display_mode *mode); extern void drm_mode_debug_printmodeline(struct drm_device *dev, @@ -445,5 +443,18 @@ extern int drm_mode_getoutput(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int drm_mode_setcrtc(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); +extern void drm_mode_list_concat(struct list_head *head, + struct list_head *new); +extern void drm_mode_validate_size(struct drm_device *dev, + struct list_head *mode_list, + int maxX, int maxY, int maxPitch); +extern void drm_mode_prune_invalid(struct drm_device *dev, + struct list_head *mode_list, bool verbose); +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 struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev); + #endif /* __DRM_CRTC_H__ */ |