Kaydet (Commit) f84ae2ab authored tarafından Fatih Aşıcı's avatar Fatih Aşıcı

Remove ddc module

üst 760a0cf9
......@@ -25,16 +25,6 @@ setup(name="zorg",
license="GNU GPL2",
url="http://www.pardus.org.tr/",
packages = ["zorg"],
ext_modules = [
Extension("zorg.ddc",
sources=[
"zorg/ddc/ddc.c",
"zorg/ddc/vbe.c",
"zorg/ddc/vesamode.c"
],
libraries=["x86"]
)
],
scripts = ["zorg-cli", "inf2mondb"],
data_files = [
("/usr/lib/X11", ["data/DriversDB", "data/MonitorsDB"]),
......
This diff is collapsed.
This diff is collapsed.
#ifndef vbe_h
#define vbe_h
#ident "$Id: vbe.h,v 1.1 1999/11/15 13:02:13 prigaux Exp $"
#include <sys/types.h>
/* Record returned by int 0x10, function 0x4f, subfunction 0x00. */
struct vbe_info {
unsigned char signature[4];
unsigned char version[2];
union {
struct {
u_int16_t ofs;
u_int16_t seg;
} addr;
const char *string;
} oem_name;
u_int32_t capabilities;
union {
struct {
u_int16_t ofs;
u_int16_t seg;
} addr;
u_int16_t *list;
} mode_list;
u_int16_t memory_size;
/* VESA 3.0+ */
u_int16_t vbe_revision;
union {
struct {
u_int16_t ofs;
u_int16_t seg;
} addr;
const char *string;
} vendor_name;
union {
struct {
u_int16_t ofs;
u_int16_t seg;
} addr;
const char *string;
} product_name;
union {
struct {
u_int16_t ofs;
u_int16_t seg;
} addr;
const char *string;
} product_revision;
char reserved1[222];
char reserved2[256];
} __attribute__ ((packed));
/* Stuff returned by int 0x10, function 0x4f, subfunction 0x01. */
struct vbe_mode_info {
/* required for all VESA versions */
struct {
/* VBE 1.0+ */
u_int16_t supported: 1;
u_int16_t optional_info_available: 1;
u_int16_t bios_output_supported: 1;
u_int16_t color: 1;
u_int16_t graphics: 1;
/* VBE 2.0+ */
u_int16_t not_vga_compatible: 1;
u_int16_t not_bank_switched: 1;
u_int16_t lfb: 1;
/* VBE 1.0+ */
u_int16_t unknown: 1;
u_int16_t must_enable_directaccess_in_10: 1;
} mode_attributes;
struct {
unsigned char exists: 1;
unsigned char readable: 1;
unsigned char writeable: 1;
unsigned char reserved: 5;
} windowa_attributes, windowb_attributes;
u_int16_t window_granularity;
u_int16_t window_size;
u_int16_t windowa_start_segment, windowb_start_segment;
u_int16_t window_positioning_seg, window_positioning_ofs;
u_int16_t bytes_per_scanline;
/* optional for VESA 1.0/1.1, required for OEM modes */
u_int16_t w, h;
unsigned char cell_width, cell_height;
unsigned char memory_planes;
unsigned char bpp;
unsigned char banks;
enum {
memory_model_text = 0,
memory_model_cga = 1,
memory_model_hgc = 2,
memory_model_ega16 = 3,
memory_model_packed_pixel = 4,
memory_model_sequ256 = 5,
memory_model_direct_color = 6,
memory_model_yuv = 7,
} memory_model: 8;
unsigned char bank_size;
unsigned char image_pages;
unsigned char reserved1;
/* required for VESA 1.2+ */
unsigned char red_mask, red_field;
unsigned char green_mask, green_field;
unsigned char blue_mask, blue_field;
unsigned char reserved_mask, reserved_field;
unsigned char direct_color_mode_info;
/* VESA 2.0+ */
u_int32_t linear_buffer_address;
u_int32_t offscreen_memory_address;
u_int16_t offscreen_memory_size;
unsigned char reserved2[206];
} __attribute__ ((packed));
/* Modeline information used by XFree86. */
struct vbe_modeline {
u_int16_t width, height;
unsigned char interlaced;
float refresh;
char *modeline;
float hfreq, vfreq, pixel_clock;
};
/* Aspect ratios used in EDID info. */
enum vbe_edid_aspect {
aspect_unknown = 0,
aspect_75,
aspect_8,
aspect_5625,
};
/* Detailed timing information used in EDID v1.x */
struct vbe_edid_detailed_timing {
u_int16_t pixel_clock;
#define VBE_EDID_DETAILED_TIMING_PIXEL_CLOCK(_x) \
((_x).pixel_clock * 10000)
unsigned char horizontal_active;
unsigned char horizontal_blanking;
unsigned char horizontal_blanking_hi: 4;
unsigned char horizontal_active_hi: 4;
#define VBE_EDID_DETAILED_TIMING_HORIZONTAL_ACTIVE(_x) \
(((_x).horizontal_active_hi << 8) + (_x).horizontal_active)
#define VBE_EDID_DETAILED_TIMING_HORIZONTAL_BLANKING(_x) \
(((_x).horizontal_blanking_hi << 8) + (_x).horizontal_blanking)
unsigned char vertical_active;
unsigned char vertical_blanking;
unsigned char vertical_blanking_hi: 4;
unsigned char vertical_active_hi: 4;
#define VBE_EDID_DETAILED_TIMING_VERTICAL_ACTIVE(_x) \
(((_x).vertical_active_hi << 8) + (_x).vertical_active)
#define VBE_EDID_DETAILED_TIMING_VERTICAL_BLANKING(_x) \
(((_x).vertical_blanking_hi << 8) + (_x).vertical_blanking)
unsigned char hsync_offset;
unsigned char hsync_pulse_width;
unsigned char vsync_pulse_width: 4;
unsigned char vsync_offset: 4;
unsigned char vsync_pulse_width_hi: 2;
unsigned char vsync_offset_hi: 2;
unsigned char hsync_pulse_width_hi: 2;
unsigned char hsync_offset_hi: 2;
#define VBE_EDID_DETAILED_TIMING_HSYNC_OFFSET(_x) \
(((_x).hsync_offset_hi << 8) + (_x).hsync_offset)
#define VBE_EDID_DETAILED_TIMING_HSYNC_PULSE_WIDTH(_x) \
(((_x).hsync_pulse_width_hi << 8) + (_x).hsync_pulse_width)
#define VBE_EDID_DETAILED_TIMING_VSYNC_OFFSET(_x) \
(((_x).vsync_offset_hi << 4) + (_x).vsync_offset)
#define VBE_EDID_DETAILED_TIMING_VSYNC_PULSE_WIDTH(_x) \
(((_x).vsync_pulse_width_hi << 4) + (_x).vsync_pulse_width)
unsigned char himage_size;
unsigned char vimage_size;
unsigned char vimage_size_hi: 4;
unsigned char himage_size_hi: 4;
#define VBE_EDID_DETAILED_TIMING_HIMAGE_SIZE(_x) \
(((_x).himage_size_hi << 8) + (_x).himage_size)
#define VBE_EDID_DETAILED_TIMING_VIMAGE_SIZE(_x) \
(((_x).vimage_size_hi << 8) + (_x).vimage_size)
unsigned char hborder;
unsigned char vborder;
struct {
unsigned char stereo_mode: 1;
unsigned char vsync_positive: 1;
unsigned char hsync_positive: 1;
unsigned char separate_sync: 2;
unsigned char stereo: 2;
unsigned char interlaced: 1;
} flags __attribute__ ((packed));
} __attribute__ ((packed));
enum {
vbe_edid_monitor_descriptor_serial = 0xff,
vbe_edid_monitor_descriptor_ascii = 0xfe,
vbe_edid_monitor_descriptor_range = 0xfd,
vbe_edid_monitor_descriptor_name = 0xfc,
} vbe_edid_monitor_descriptor_types;
struct vbe_edid_monitor_descriptor {
u_int16_t zero_flag_1;
unsigned char zero_flag_2;
unsigned char type;
unsigned char zero_flag_3;
union {
char string[13];
struct {
unsigned char vertical_min;
unsigned char vertical_max;
unsigned char horizontal_min;
unsigned char horizontal_max;
unsigned char pixel_clock_max;
unsigned char gtf_data[8];
} range_data;
} data;
} __attribute__ ((packed));
struct vbe_edid1_info {
unsigned char header[8];
struct {
u_int16_t char3: 5;
u_int16_t char2: 5;
u_int16_t char1: 5;
u_int16_t zero: 1;
} manufacturer_name __attribute__ ((packed));
u_int16_t product_code;
u_int32_t serial_number;
unsigned char week;
unsigned char year;
unsigned char version;
unsigned char revision;
struct {
unsigned char serration_vsync: 1;
unsigned char sync_on_green: 1;
unsigned char composite_sync: 1;
unsigned char separate_sync: 1;
unsigned char blank_to_blank_setup: 1;
unsigned char video_level: 2;
unsigned char digital: 1;
} video_input_definition __attribute__ ((packed));
unsigned char max_size_horizontal;
unsigned char max_size_vertical;
unsigned char gamma;
struct {
unsigned char default_gtf_supported: 1;
unsigned char pereferred_timing_mode: 1;
unsigned char standard_color_space: 1;
unsigned char display_type: 2;
unsigned char active_off: 1;
unsigned char suspend: 1;
unsigned char standby: 1;
} feature_support __attribute__ ((packed));
unsigned char color_characteristics[10];
struct {
unsigned char timing_1280x1024_75: 1;
unsigned char timing_1024x768_75: 1;
unsigned char timing_1024x768_70: 1;
unsigned char timing_1024x768_60: 1;
unsigned char timing_1024x768_87i: 1;
unsigned char timing_832x624_75: 1;
unsigned char timing_800x600_75: 1;
unsigned char timing_800x600_72: 1;
unsigned char timing_800x600_60: 1;
unsigned char timing_800x600_56: 1;
unsigned char timing_640x480_75: 1;
unsigned char timing_640x480_72: 1;
unsigned char timing_640x480_67: 1;
unsigned char timing_640x480_60: 1;
unsigned char timing_720x400_88: 1;
unsigned char timing_720x400_70: 1;
} established_timings __attribute__ ((packed));
struct {
unsigned char timing_1152x870_75: 1;
unsigned char reserved: 7;
} manufacturer_timings __attribute__ ((packed));
struct {
u_int16_t xresolution: 8;
u_int16_t vfreq: 6;
u_int16_t aspect: 2;
} standard_timing[8] __attribute__ ((packed));
union {
struct vbe_edid_detailed_timing detailed_timing[4];
struct vbe_edid_monitor_descriptor monitor_descriptor[4];
} monitor_details __attribute__ ((packed));
unsigned char extension_flag;
unsigned char checksum;
unsigned char padding[128];
} __attribute__ ((packed));
#define VBE_LINEAR_FRAMEBUFFER 0x4000
/* Get VESA information. */
struct vbe_info *vbe_get_vbe_info();
/* Get information about a particular video mode, bitwise or with
VBE_LINEAR_FRAMEBUFFER to check if LFB version is supported. */
struct vbe_mode_info *vbe_get_mode_info(u_int16_t mode);
/* Check if EDID reads are supported, and do them. */
int vbe_get_edid_supported(int adapter);
struct vbe_edid1_info *vbe_get_edid_info(int adapter);
/* Get the current video mode, -1 on error. */
int32_t vbe_get_mode();
/* Set a new video mode, bitwise or with VBE_LINEAR_FRAMEBUFFER. */
void vbe_set_mode(u_int16_t mode);
/* Save/restore the SVGA state. Call free() on the state record when done. */
const void *vbe_save_svga_state();
void vbe_restore_svga_state(const void *state);
/* Get the ranges of values suitable for the attached monitor. */
void vbe_get_edid_ranges(struct vbe_edid1_info *edid,
unsigned char *hmin, unsigned char *hmax,
unsigned char *vmin, unsigned char *vmax);
/* Get a list of modelines that will work with this monitor. */
struct vbe_modeline *vbe_get_edid_modelines(int adapter);
#endif
#include "vesamode.h"
#ident "$Id: vesamode.c,v 1.1 1999/11/15 13:02:13 prigaux Exp $"
/* Known standard VESA modes. */
struct vesa_mode_t known_vesa_modes[] = {
/* VESA 1.0/1.1 ? */
{0x100, 640, 400, 256, "640x400x256"},
{0x101, 640, 480, 256, "640x480x256"},
{0x102, 800, 600, 16, "800x600x16"},
{0x103, 800, 600, 256, "800x600x256"},
{0x104, 1024, 768, 16, "1024x768x16"},
{0x105, 1024, 768, 256, "1024x768x256"},
{0x106, 1280, 1024, 16, "1280x1024x16"},
{0x107, 1280, 1024, 256,"1280x1024x256"},
{0x108, 80, 60, 16, "80x60 (text)"},
{0x109, 132, 25, 16, "132x25 (text)"},
{0x10a, 132, 43, 16, "132x43 (text)"},
{0x10b, 132, 50, 16, "132x50 (text)"},
{0x10c, 132, 60, 16, "132x60 (text)"},
/* VESA 1.2+ */
{0x10d, 320, 200, 32768, "320x200x32k"},
{0x10e, 320, 200, 65536, "320x200x64k"},
{0x10f, 320, 200, 16777216, "320x200x16m"},
{0x110, 640, 480, 32768, "640x480x32k"},
{0x111, 640, 480, 65536, "640x480x64k"},
{0x112, 640, 480, 16777216, "640x480x16m"},
{0x113, 800, 600, 32768, "800x600x32k"},
{0x114, 800, 600, 65536, "800x600x64k"},
{0x115, 800, 600, 16777216, "800x600x16m"},
{0x116, 1024, 768, 32768, "1024x768x32k"},
{0x117, 1024, 768, 65536, "1024x768x64k"},
{0x118, 1024, 768, 16777216, "1024x768x16m"},
{0x119, 1280, 1024, 32768, "1280x1024x32k"},
{0x11a, 1280, 1024, 65536, "1280x1024x64k"},
{0x11b, 1280, 1024, 16777216, "1280x1024x16m"},
/* VESA 2.0+ */
{0x120, 1600, 1200, 256, "1600x1200x256"},
{0x121, 1600, 1200, 32768, "1600x1200x32k"},
{0x122, 1600, 1200, 65536, "1600x1200x64k"},
{ 0, 0, 0, 0, ""},
};
struct vesa_timing_t known_vesa_timings[] = {
/* Source: VESA Monitor Timing Specifications 1.0 rev 0.8 */
{ 640, 350, 85, 31.500, { 640, 32, 64, 96, 350,32, 3, 60},
hsync_pos, vsync_neg, 37.861, 85.080},
{ 640, 400, 85, 31.500, { 640, 32, 64, 96, 400, 1, 3, 41},
hsync_neg, vsync_pos, 37.861, 85.080},
{ 720, 400, 85, 35.500, { 720, 36, 72, 108, 400, 1, 3, 42},
hsync_neg, vsync_pos, 37.861, 85.080},
{ 640, 480, 60, 25.175, { 640, 8, 96, 40, 480, 2, 2, 25},
hsync_neg, vsync_neg, 31.469, 59.940},
{ 640, 480, 72, 31.500, { 640, 16, 40, 120, 480, 1, 3, 20},
hsync_neg, vsync_neg, 37.861, 72.809},
{ 640, 480, 75, 31.500, { 640, 16, 64, 120, 480, 1, 3, 16},
hsync_neg, vsync_neg, 37.500, 75.000},
{ 640, 480, 85, 36.000, { 640, 56, 56, 80, 480, 1, 3, 25},
hsync_neg, vsync_neg, 43.269, 85.008},
{ 800, 600, 56, 36.000, { 800, 24, 72, 128, 600, 1, 2, 22},
hsync_pos, vsync_pos, 35.156, 56.250},
{ 800, 600, 60, 40.000, { 800, 40, 128, 88, 600, 1, 4, 23},
hsync_pos, vsync_pos, 37.879, 60.317},
{ 800, 600, 72, 50.000, { 800, 56, 120, 64, 600,37, 6, 23},
hsync_pos, vsync_pos, 48.077, 72.188},
{ 800, 600, 75, 49.500, { 800, 16, 80, 160, 600, 1, 3, 21},
hsync_pos, vsync_pos, 46.875, 75.000},
{ 800, 600, 85, 56.250, { 800, 32, 64, 152, 600, 1, 3, 27},
hsync_pos, vsync_pos, 53.674, 85.061},
{1024, 768, 43, 44.900, {1024, 8, 176, 56, 768, 0, 4, 20},
hsync_pos, vsync_pos, 35.522, 86.957},
{1024, 768, 60, 65.000, {1024, 24, 136, 160, 768, 3, 6, 29},
hsync_neg, vsync_neg, 48.363, 60.004},
{1024, 768, 70, 75.000, {1024, 24, 136, 144, 768, 3, 6, 29},
hsync_neg, vsync_neg, 56.476, 70.069},
{1024, 768, 75, 78.750, {1024, 16, 96, 176, 768, 1, 3, 28},
hsync_pos, vsync_pos, 60.023, 75.029},
{1024, 768, 85, 94.500, {1024, 48, 96, 208, 768, 1, 3, 36},
hsync_pos, vsync_pos, 68.677, 84.997},
{1152, 864, 70, 94.200, {1152, 32, 96, 192, 864, 1, 3, 46},
hsync_pos, vsync_pos, 0.000, 0.000},
{1152, 864, 75, 108.000, {1152, 64, 128, 256, 864, 1, 3, 32},
hsync_pos, vsync_pos, 67.500, 75.000},
{1152, 864, 85, 121.500, {1152, 64, 128, 224, 864, 1, 3, 43},
hsync_pos, vsync_pos, 0.000, 0.000},
{1280, 960, 60, 108.000, {1280, 96, 112, 312, 960, 1, 3, 36},
hsync_pos, vsync_pos, 60.000, 60.000},
{1280, 960, 85, 148.500, {1280, 64, 160, 224, 960, 1, 3, 47},
hsync_pos, vsync_pos, 85.398, 85.002},
{1280, 1024, 60, 108.000, {1280, 48, 112, 248, 1024, 1, 3, 38},
hsync_pos, vsync_pos, 63.981, 60.020},
{1280, 1024, 75, 135.000, {1280, 16, 144, 248, 1024, 1, 3, 38},
hsync_pos, vsync_pos, 79.976, 75.025},
{1280, 1024, 85, 157.500, {1280, 64, 160, 224, 1024, 1, 3, 44},
hsync_pos, vsync_pos, 91.146, 85.024},
{1600, 1200, 60, 162.000, {1600, 64, 192, 304, 1200, 1, 3, 46},
hsync_pos, vsync_pos, 75.000, 60.000},
{1600, 1200, 65, 175.500, {1600, 64, 192, 304, 1200, 1, 3, 46},
hsync_pos, vsync_pos, 81.250, 65.000},
{1600, 1200, 70, 189.000, {1600, 64, 192, 304, 1200, 1, 3, 46},
hsync_pos, vsync_pos, 87.500, 70.000},
{1600, 1200, 75, 202.500, {1600, 64, 192, 304, 1200, 1, 3, 46},
hsync_pos, vsync_pos, 93.750, 75.000},
{1600, 1200, 85, 229.500, {1600, 64, 192, 304, 1200, 1, 3, 46},
hsync_pos, vsync_pos, 106.250, 85.000},
{1792, 1344, 60, 204.750, {1792,128, 200, 328, 1344, 1, 3, 46},
hsync_neg, vsync_pos, 83.640, 60.000},
{1792, 1344, 75, 261.000, {1792, 96, 216, 352, 1344, 1, 3, 69},
hsync_neg, vsync_pos, 106.270, 74.997},
{1856, 1392, 60, 218.250, {1856, 96, 224, 352, 1392, 1, 3, 43},
hsync_neg, vsync_pos, 86.333, 59.995},
{1856, 1392, 75, 288.000, {1856,128, 224, 352, 1392, 1, 3,104},
hsync_neg, vsync_pos, 112.500, 75.000},
{1920, 1440, 60, 234.000, {1920,128, 208, 344, 1440, 1, 3, 56},
hsync_neg, vsync_pos, 90.000, 60.000},
{1920, 1440, 75, 297.000, {1920,144, 224, 352, 1440, 1, 3, 56},
hsync_neg, vsync_pos, 112.500, 75.000},
{ 0, 0, 0, 0.000, { 0, 0, 0, 0, 0, 0, 0, 0},
000000000, 000000000, 0.000, 0.000},
};
#ifndef vesamode_h
#define vesamode_h
#include <sys/types.h>
#ident "$Id: vesamode.h,v 1.1 1999/11/15 13:02:13 prigaux Exp $"
typedef enum { hsync_neg = 0, hsync_pos } hsync_t;
typedef enum { vsync_neg = 0, vsync_pos } vsync_t;
struct vesa_mode_t {
u_int16_t number;
u_int16_t x, y;
u_int32_t colors;
const char *text;
const char *modeline;
};
struct vesa_timing_t {
u_int16_t x, y;
float refresh;
float dotclock;
u_int16_t timings[8];
hsync_t hsync;
vsync_t vsync;
float hfreq;
float vfreq;
};
extern struct vesa_mode_t known_vesa_modes[];
extern struct vesa_timing_t known_vesa_timings[];
#endif /* vesamode_h */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment