Keep display info in struct display_info
Some fields had snuck into the drm_output structure. Put them back and fill in more stuff from the EDID block.main
parent
386ea38b8e
commit
0a6e301e6d
|
@ -643,7 +643,6 @@ struct drm_output *drm_output_create(struct drm_device *dev,
|
||||||
output->id = drm_idr_get(dev, output);
|
output->id = drm_idr_get(dev, output);
|
||||||
output->output_type = output_type;
|
output->output_type = output_type;
|
||||||
output->output_type_id = 1; /* TODO */
|
output->output_type_id = 1; /* TODO */
|
||||||
output->subpixel_order = SubPixelUnknown;
|
|
||||||
INIT_LIST_HEAD(&output->user_modes);
|
INIT_LIST_HEAD(&output->user_modes);
|
||||||
INIT_LIST_HEAD(&output->probed_modes);
|
INIT_LIST_HEAD(&output->probed_modes);
|
||||||
INIT_LIST_HEAD(&output->modes);
|
INIT_LIST_HEAD(&output->modes);
|
||||||
|
@ -1555,9 +1554,9 @@ int drm_mode_getoutput(struct drm_device *dev,
|
||||||
|
|
||||||
out_resp->output_type = output->output_type;
|
out_resp->output_type = output->output_type;
|
||||||
out_resp->output_type_id = output->output_type_id;
|
out_resp->output_type_id = output->output_type_id;
|
||||||
out_resp->mm_width = output->mm_width;
|
out_resp->mm_width = output->display_info.width_mm;
|
||||||
out_resp->mm_height = output->mm_height;
|
out_resp->mm_height = output->display_info.height_mm;
|
||||||
out_resp->subpixel = output->subpixel_order;
|
out_resp->subpixel = output->display_info.subpixel_order;
|
||||||
out_resp->connection = output->status;
|
out_resp->connection = output->status;
|
||||||
if (output->crtc)
|
if (output->crtc)
|
||||||
out_resp->crtc = output->crtc->id;
|
out_resp->crtc = output->crtc->id;
|
||||||
|
|
|
@ -199,7 +199,7 @@ struct drm_display_info {
|
||||||
bool gtf_supported;
|
bool gtf_supported;
|
||||||
bool standard_color;
|
bool standard_color;
|
||||||
enum {
|
enum {
|
||||||
monochrome,
|
monochrome = 0,
|
||||||
rgb,
|
rgb,
|
||||||
other,
|
other,
|
||||||
unknown,
|
unknown,
|
||||||
|
@ -225,6 +225,8 @@ struct drm_display_info {
|
||||||
unsigned int wpx2, wpy2;
|
unsigned int wpx2, wpy2;
|
||||||
unsigned int wpgamma2;
|
unsigned int wpgamma2;
|
||||||
|
|
||||||
|
enum subpixel_order subpixel_order;
|
||||||
|
|
||||||
/* Preferred mode (if any) */
|
/* Preferred mode (if any) */
|
||||||
struct drm_display_mode *preferred_mode;
|
struct drm_display_mode *preferred_mode;
|
||||||
char *raw_edid; /* if any */
|
char *raw_edid; /* if any */
|
||||||
|
@ -376,8 +378,6 @@ struct drm_crtc {
|
||||||
int desired_x, desired_y;
|
int desired_x, desired_y;
|
||||||
const struct drm_crtc_funcs *funcs;
|
const struct drm_crtc_funcs *funcs;
|
||||||
void *driver_private;
|
void *driver_private;
|
||||||
|
|
||||||
/* RRCrtcPtr randr_crtc? */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct drm_crtc *drm_crtc_create(struct drm_device *dev,
|
extern struct drm_crtc *drm_crtc_create(struct drm_device *dev,
|
||||||
|
@ -438,9 +438,6 @@ struct drm_output_funcs {
|
||||||
* @initial_x: initial x position for this output
|
* @initial_x: initial x position for this output
|
||||||
* @initial_y: initial y position for this output
|
* @initial_y: initial y position for this output
|
||||||
* @status: output connected?
|
* @status: output connected?
|
||||||
* @subpixel_order: for this output
|
|
||||||
* @mm_width: displayable width of output in mm
|
|
||||||
* @mm_height: displayable height of output in mm
|
|
||||||
* @funcs: output control functions
|
* @funcs: output control functions
|
||||||
* @driver_private: private driver data
|
* @driver_private: private driver data
|
||||||
*
|
*
|
||||||
|
@ -465,20 +462,13 @@ struct drm_output {
|
||||||
bool doublescan_allowed;
|
bool doublescan_allowed;
|
||||||
struct list_head modes; /* list of modes on this output */
|
struct list_head modes; /* list of modes on this output */
|
||||||
|
|
||||||
/*
|
|
||||||
OptionInfoPtr options;
|
|
||||||
XF86ConfMonitorPtr conf_monitor;
|
|
||||||
*/
|
|
||||||
int initial_x, initial_y;
|
int initial_x, initial_y;
|
||||||
enum drm_output_status status;
|
enum drm_output_status status;
|
||||||
|
|
||||||
/* these are modes added by probing with DDC or the BIOS */
|
/* these are modes added by probing with DDC or the BIOS */
|
||||||
struct list_head probed_modes;
|
struct list_head probed_modes;
|
||||||
|
|
||||||
/* xf86MonPtr MonInfo; */
|
struct drm_display_info display_info;
|
||||||
enum subpixel_order subpixel_order;
|
|
||||||
int mm_width, mm_height;
|
|
||||||
struct drm_display_info *monitor_info; /* if any */
|
|
||||||
const struct drm_output_funcs *funcs;
|
const struct drm_output_funcs *funcs;
|
||||||
void *driver_private;
|
void *driver_private;
|
||||||
|
|
||||||
|
|
|
@ -292,6 +292,10 @@ static int add_detailed_info(struct drm_output *output, struct edid *edid)
|
||||||
newmode->type |= DRM_MODE_TYPE_PREFERRED;
|
newmode->type |= DRM_MODE_TYPE_PREFERRED;
|
||||||
drm_mode_probed_add(output, newmode);
|
drm_mode_probed_add(output, newmode);
|
||||||
|
|
||||||
|
/* Use first one for output's preferred mode */
|
||||||
|
if (!output->display_info.preferred_mode)
|
||||||
|
output->display_info.preferred_mode =
|
||||||
|
newmode;
|
||||||
modes++;
|
modes++;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -460,6 +464,9 @@ struct edid *drm_get_edid(struct drm_output *output,
|
||||||
kfree(edid);
|
kfree(edid);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output->display_info.raw_edid = (char *)edid;
|
||||||
|
|
||||||
return edid;
|
return edid;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_get_edid);
|
EXPORT_SYMBOL(drm_get_edid);
|
||||||
|
@ -488,6 +495,25 @@ int drm_add_edid_modes(struct drm_output *output, struct edid *edid)
|
||||||
num_modes += add_established_modes(output, edid);
|
num_modes += add_established_modes(output, edid);
|
||||||
num_modes += add_standard_modes(output, edid);
|
num_modes += add_standard_modes(output, edid);
|
||||||
num_modes += add_detailed_info(output, edid);
|
num_modes += add_detailed_info(output, edid);
|
||||||
|
|
||||||
|
output->display_info.serration_vsync = edid->serration_vsync;
|
||||||
|
output->display_info.sync_on_green = edid->sync_on_green;
|
||||||
|
output->display_info.composite_sync = edid->composite_sync;
|
||||||
|
output->display_info.separate_syncs = edid->separate_syncs;
|
||||||
|
output->display_info.blank_to_black = edid->blank_to_black;
|
||||||
|
output->display_info.video_level = edid->video_level;
|
||||||
|
output->display_info.digital = edid->digital;
|
||||||
|
output->display_info.width_mm = edid->width_cm * 10;
|
||||||
|
output->display_info.height_mm = edid->height_cm * 10;
|
||||||
|
output->display_info.gamma = edid->gamma;
|
||||||
|
output->display_info.gtf_supported = edid->default_gtf;
|
||||||
|
output->display_info.standard_color = edid->standard_color;
|
||||||
|
output->display_info.display_type = edid->display_type;
|
||||||
|
output->display_info.active_off_supported = edid->pm_active_off;
|
||||||
|
output->display_info.suspend_supported = edid->pm_suspend;
|
||||||
|
output->display_info.standby_supported = edid->pm_standby;
|
||||||
|
output->display_info.gamma = edid->gamma;
|
||||||
|
|
||||||
return num_modes;
|
return num_modes;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_add_edid_modes);
|
EXPORT_SYMBOL(drm_add_edid_modes);
|
||||||
|
|
|
@ -298,24 +298,15 @@ static int intel_lvds_get_modes(struct drm_output *output)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* Didn't get an EDID */
|
/* Didn't get an EDID, so
|
||||||
if (!output->monitor_info) {
|
* Set wide sync ranges so we get all modes
|
||||||
struct drm_display_info *dspinfo;
|
|
||||||
dspinfo = kzalloc(sizeof(*output->monitor_info), GFP_KERNEL);
|
|
||||||
if (!dspinfo)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
/* Set wide sync ranges so we get all modes
|
|
||||||
* handed to valid_mode for checking
|
* handed to valid_mode for checking
|
||||||
*/
|
*/
|
||||||
dspinfo->min_vfreq = 0;
|
output->display_info.min_vfreq = 0;
|
||||||
dspinfo->max_vfreq = 200;
|
output->display_info.max_vfreq = 200;
|
||||||
dspinfo->min_hfreq = 0;
|
output->display_info.min_hfreq = 0;
|
||||||
dspinfo->max_hfreq = 200;
|
output->display_info.max_hfreq = 200;
|
||||||
output->monitor_info = dspinfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
if (dev_priv->panel_fixed_mode != NULL) {
|
if (dev_priv->panel_fixed_mode != NULL) {
|
||||||
struct drm_display_mode *mode =
|
struct drm_display_mode *mode =
|
||||||
drm_mode_duplicate(dev, dev_priv->panel_fixed_mode);
|
drm_mode_duplicate(dev, dev_priv->panel_fixed_mode);
|
||||||
|
@ -385,7 +376,7 @@ void intel_lvds_init(struct drm_device *dev)
|
||||||
|
|
||||||
intel_output->type = INTEL_OUTPUT_LVDS;
|
intel_output->type = INTEL_OUTPUT_LVDS;
|
||||||
output->driver_private = intel_output;
|
output->driver_private = intel_output;
|
||||||
output->subpixel_order = SubPixelHorizontalRGB;
|
output->display_info.subpixel_order = SubPixelHorizontalRGB;
|
||||||
output->interlace_allowed = FALSE;
|
output->interlace_allowed = FALSE;
|
||||||
output->doublescan_allowed = FALSE;
|
output->doublescan_allowed = FALSE;
|
||||||
|
|
||||||
|
|
|
@ -1083,28 +1083,28 @@ void intel_sdvo_init(struct drm_device *dev, int output_device)
|
||||||
if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB0)
|
if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB0)
|
||||||
{
|
{
|
||||||
sdvo_priv->active_outputs = SDVO_OUTPUT_RGB0;
|
sdvo_priv->active_outputs = SDVO_OUTPUT_RGB0;
|
||||||
output->subpixel_order = SubPixelHorizontalRGB;
|
output->display_info.subpixel_order = SubPixelHorizontalRGB;
|
||||||
output_type = DRM_MODE_OUTPUT_DAC;
|
output_type = DRM_MODE_OUTPUT_DAC;
|
||||||
connector_type = ConnectorVGA;
|
connector_type = ConnectorVGA;
|
||||||
}
|
}
|
||||||
else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB1)
|
else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB1)
|
||||||
{
|
{
|
||||||
sdvo_priv->active_outputs = SDVO_OUTPUT_RGB1;
|
sdvo_priv->active_outputs = SDVO_OUTPUT_RGB1;
|
||||||
output->subpixel_order = SubPixelHorizontalRGB;
|
output->display_info.subpixel_order = SubPixelHorizontalRGB;
|
||||||
output_type = DRM_MODE_OUTPUT_DAC;
|
output_type = DRM_MODE_OUTPUT_DAC;
|
||||||
connector_type = ConnectorVGA;
|
connector_type = ConnectorVGA;
|
||||||
}
|
}
|
||||||
else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS0)
|
else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS0)
|
||||||
{
|
{
|
||||||
sdvo_priv->active_outputs = SDVO_OUTPUT_TMDS0;
|
sdvo_priv->active_outputs = SDVO_OUTPUT_TMDS0;
|
||||||
output->subpixel_order = SubPixelHorizontalRGB;
|
output->display_info.subpixel_order = SubPixelHorizontalRGB;
|
||||||
output_type = DRM_MODE_OUTPUT_TMDS;
|
output_type = DRM_MODE_OUTPUT_TMDS;
|
||||||
connector_type = ConnectorDVID;
|
connector_type = ConnectorDVID;
|
||||||
}
|
}
|
||||||
else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS1)
|
else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS1)
|
||||||
{
|
{
|
||||||
sdvo_priv->active_outputs = SDVO_OUTPUT_TMDS1;
|
sdvo_priv->active_outputs = SDVO_OUTPUT_TMDS1;
|
||||||
output->subpixel_order = SubPixelHorizontalRGB;
|
output->display_info.subpixel_order = SubPixelHorizontalRGB;
|
||||||
output_type = DRM_MODE_OUTPUT_TMDS;
|
output_type = DRM_MODE_OUTPUT_TMDS;
|
||||||
connector_type = ConnectorDVID;
|
connector_type = ConnectorDVID;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue