+/*
+ * Copyright (c) 2007 Intel Corporation
+ * Jesse Barnes <jesse.barnes@intel.com>
+ */
+
#include <linux/i2c.h>
#include <linux/fb.h>
#include "drmP.h"
u16 sec_gtf_toggle; /* A000=use above, 20=use below */
u8 hfreq_start_khz; /* need to multiply by 2 */
u8 c; /* need to divide by 2 */
- u16 m;
+ u16 m; /* FIXME: byte order */
u8 k;
u8 j; /* need to divide by 2 */
} __attribute__((packed));
struct edid {
u8 header[8];
/* Vendor & product info */
- u16 mfg_id;
- u16 prod_code;
- u32 serial;
+ u16 mfg_id; /* FIXME: byte order */
+ u16 prod_code; /* FIXME: byte order */
+ u32 serial; /* FIXME: byte order */
u8 mfg_week;
u8 mfg_year;
/* EDID version */
*
* Punts for now.
*/
- struct drm_display_mode *drm_mode_std(struct std_timing *t)
+ struct drm_display_mode *drm_mode_std(struct drm_device *dev,
+ struct std_timing *t)
{
// struct fb_videomode mode;
struct drm_display_mode *mode;
int hsize = t->hsize * 8 + 248, vsize;
- mode = kzalloc(sizeof(struct drm_display_mode), GFP_KERNEL);
+ mode = drm_crtc_mode_create(dev);
if (!mode)
return NULL;
return mode;
}
- struct drm_display_mode *drm_mode_detailed(struct detailed_timing *timing,
+ struct drm_display_mode *drm_mode_detailed(drm_device_t *dev,
+ struct detailed_timing *timing,
bool preferred)
{
struct drm_display_mode *mode;
return NULL;
}
- mode = kzalloc(sizeof(struct drm_display_mode), GFP_KERNEL);
+ mode = drm_crtc_mode_create(dev);
if (!mode)
return NULL;
*/
static int add_established_modes(struct drm_output *output, struct edid *edid)
{
+ struct drm_device *dev = output->dev;
unsigned long est_bits = edid->established_timings.t1 |
(edid->established_timings.t2 << 8) |
((edid->established_timings.mfg_rsvd & 0x80) << 9);
for (i = 0; i <= EDID_EST_TIMINGS; i++)
if (est_bits & (1<<i)) {
drm_mode_probed_add(output,
- drm_mode_duplicate(&established_modes[i]));
+ drm_mode_duplicate(dev, &established_modes[i]));
modes++;
}
static int add_standard_modes(struct drm_output *output, struct edid *edid)
{
int i, modes = 0;
+ struct drm_device *dev = output->dev;
for (i = 0; i < EDID_STD_TIMINGS; i++) {
struct std_timing *t = &edid->standard_timings[i];
continue;
drm_mode_probed_add(output,
- drm_mode_std(&edid->standard_timings[i]));
+ drm_mode_std(dev, &edid->standard_timings[i]));
modes++;
}
{
int i, j, modes = 0;
bool preferred = 0;
+ struct drm_device *dev = output->dev;
for (i = 0; i < EDID_DETAILED_TIMINGS; i++) {
struct detailed_timing *timing = &edid->detailed_timings[i];
if (i == 0 && edid->preferred_timing)
preferred = 1;
drm_mode_probed_add(output,
- drm_mode_detailed(timing, preferred));
+ drm_mode_detailed(dev, timing, preferred));
modes++;
continue;
}
struct std_timing *std;
std = &data->data.timings[j];
- drm_mode_probed_add(output, drm_mode_std(std));
+ drm_mode_probed_add(output, drm_mode_std(dev, std));
modes++;
}
break;