2
*-----------------------------------------------------------------------------
5
*-----------------------------------------------------------------------------
6
* Copyright © 2002-2010, Intel Corporation.
8
* This program is free software; you can redistribute it and/or modify it
9
* under the terms and conditions of the GNU General Public License,
10
* version 2, as published by the Free Software Foundation.
12
* This program is distributed in the hope it will be useful, but WITHOUT
13
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17
* You should have received a copy of the GNU General Public License along with
18
* this program; if not, write to the Free Software Foundation, Inc.,
19
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21
*-----------------------------------------------------------------------------
24
*-----------------------------------------------------------------------------
31
#include <igd_debug.h>
33
/* PD SDK version 2 bytes,
34
* 1st byte is major version,
35
* second byte is minor version.
38
/* Update the version number each time there is an
39
* API Change or Change in data structures
41
#define PD_SDK_VERSION 0x0300 /* PD SDK Version */
47
#define NULL ((void *)0)
59
/* This needs to contain the unsigned long for vBIOS. */
61
#define BIT(x) (1L<<x)
65
* minimum, if the value < min value
66
* maximum, if the value > max value
69
#define MINMAX(val, min, max) ((val < min) ? min : ((val > max) ? max : val))
71
#define PD_REG_LIST_END 0xFFFFFFFF
72
#define PD_DAB_LIST_END 0xFFFFFFFF
73
#define PD_TIMING_LIST_END 0xFFFF
75
/* Error codes used for return values */
76
#define PD_SUCCESS 0x00 /* Success */
77
#define PD_ERR_NOMEM 0x01 /* Unable to allocated requested mem */
78
#define PD_ERR_NODEV 0x02 /* No Device/Codec found */
79
#define PD_ERR_NODIS 0x03 /* No display found */
80
#define PD_ERR_INVALID_PTR 0x04 /* Invalid pointer passed */
81
#define PD_ERR_NULL_PTR 0x05 /* Null ptr passed */
82
#define PD_ERR_DISPLAY_TYPE 0x06 /* Unsupported display type specified */
83
#define PD_ERR_NOPORT_AVAIL 0x07 /* No port available */
84
#define PD_ERR_INTERNAL 0x08 /* Critical internal error */
85
#define PD_ERR_INVALID_POWER 0x09 /* Invalid power state specified */
86
#define PD_ERR_HAND_SHAKE 0x0A /* Magic cookie hand shake failed */
87
#define PD_ERR_MODE_NOTSUPP 0x0B /* Unsupported mode */
88
#define PD_ERR_I2C_READ 0x0C /* I2C read error */
89
#define PD_ERR_I2C_WRITE 0x0D /* I2C write error */
90
#define PD_ERR_NULL_STATE 0x0E /* Saved state is NULL */
91
/* PD_ERR_NOATTR removed. Return success with 0 count instead */
92
#define PD_ERR_NO_TIMINGS 0x10 /* No timing list */
93
#define PD_ERR_INVALID_ATTR 0x11 /* Invalid attribute */
94
#define PD_ERR_INCORR_ATTR_VALUE 0x12 /* Incorrect attr value */
95
#define PD_ERR_ATTR_CANT_CHANGE 0x13 /* Attribute value cannot be changed */
96
#define PD_ERR_VER_MISMATCH 0x14 /* PD SDK version mismatch */
97
#define PD_ERR_UNSUCCESSFUL 0x15 /* Operation unsuccessful */
99
typedef struct _pd_reg {
105
/* The following structures holds CEA EDID Extension data
106
* Edid and possibly display id would use this structure as
107
* well. PD callback would have a callback function to one the
108
* structure to retrieve EDID like data (ELD)
112
#define CEA_IEEE_HDMI_ID 0x000C03
114
#define PD_ASPECT_RATIO_NO_DATA 0
115
#define PD_ASPECT_RATIO_4_3 1
116
#define PD_ASPECT_RATIO_16_9 2
118
#define ELD_AVAIL 0x01
119
#define ELD_CANNED 0x02
120
/* Transmitter audio charactheristic */
121
#define PD_AUDIO_CHAR_AVAIL 0x10
122
/* CEA data block type */
123
#define CEA_VIDEO_DATA_BLOCK 0x40
124
#define CEA_AUDIO_DATA_BLOCK 0x20
125
#define CEA_VENDOR_DATA_BLOCK 0x60
126
#define CEA_SPEAKER_DATA_BLOCK 0x80
127
/* Audio block Tag Code */
128
#define CEA_AUDIO_LPCM 1
129
#define CEA_AUDIO_AC3 2
130
#define CEA_AUDIO_MPG1 3
131
#define CEA_AUDIO_MP3 4
132
#define CEA_AUDIO_MPG2 5
133
#define CEA_AUDIO_AAC 6
134
#define CEA_AUDIO_DTS 7
135
#define CEA_AUDIO_ATRAC 8
136
#define CEA_AUDIO_SACD 9
137
#define CEA_AUDIO_DD_PLUS 10
138
#define CEA_AUDIO_DTS_HD 11
139
#define CEA_AUDIO_MLP 12
140
/* Pixel Replication */
141
#define PIX_REPLICATION_0 1
142
#define PIX_REPLICATION_1 2
143
#define PIX_REPLICATION_3 4
145
#define HDMI_QUANTIZATION_RGB_256 0x00
146
#define HDMI_QUANTIZATION_RGB_220 0x01
147
#define HDMI_QUANTIZATION_YUV_422 0x02
148
#define HDMI_QUANTIZATION_YUV_44 0x03
150
#define HDMI_COLORIMETRY_NODATA 0x00
151
#define HDMI_COLORIMETRY_ITU601 0x01 /* SMPTE 170M, ITU601 */
152
#define HDMI_COLORIMETRY_ITU709 0x02
153
/* Audio CAP(48,96,192)Khz refer to audio_cap in CEA ELD extension*/
156
#define CAP_192_KHZ 2
157
/* Vendor Specific Data Block */
158
#define VSBD_LATENCY_FIELD 8
159
typedef struct _cea_audio_format_t{
163
unsigned char max_channels : 3;
164
unsigned char audio_format_code : 4;
165
unsigned char reserve_byte1 : 1;
171
unsigned char _32khz : 1;
172
unsigned char _44khz : 1;
173
unsigned char _48khz : 1;
174
unsigned char _88khz : 1;
175
unsigned char _96khz : 1;
176
unsigned char _176khz : 1;
177
unsigned char _192khz : 1;
178
unsigned char reserve_byte2 : 1;
181
/* 3rd byte differs between compressed & uncompressed audio */
183
unsigned char max_bitrate;
185
unsigned char _16bit : 1;
186
unsigned char _20bit : 1;
187
unsigned char _24bit : 1;
188
unsigned char reserve_byte3 : 5;
194
typedef struct _speaker_allocation_data_t{
196
unsigned char rsvd : 1;
197
unsigned char rlc_rrc : 1;
198
unsigned char flc_frc : 1;
199
unsigned char rc : 1;
200
unsigned char rl_rr : 1;
201
unsigned char fc : 1;
202
unsigned char lfe : 1;
203
unsigned char fl_fr : 1;
205
unsigned char reserved[2];
206
}speaker_allocation_data_t;
211
unsigned char code: 7;
212
unsigned char native: 1;
216
typedef struct _audio_capability_t{
217
unsigned char max_channels;
218
unsigned char _20bit;
219
unsigned char _24bit;
222
typedef struct _vsdb_t{
224
unsigned char header;
226
unsigned char vendor_block_size: 5;
227
unsigned char tag : 3;
230
unsigned char vendor_ieee_id[3];
231
unsigned char src_phy_add[2];
232
unsigned char support_ai;
233
unsigned char max_tmds_clck;
235
unsigned char latency_fields;
237
unsigned char reserve : 6;
238
unsigned char i_latency : 1;
239
unsigned char p_latency : 1;
242
unsigned char p_video_latency;
243
unsigned char p_audio_latency;
244
unsigned char i_video_latency;
245
unsigned char i_audio_latency;
249
typedef struct _cea_extension{
250
unsigned char rev_number;
251
unsigned char canned_eld;
255
unsigned char total_native_format : 4;
256
unsigned char YCC_422 : 1;
257
unsigned char YCC_444 : 1;
258
unsigned char audio_support : 1;
259
unsigned char underscan_support : 1;
263
/* Short Video Descriptor */
264
int total_short_video_desc;
265
cea_video_blk_t *short_video_desc;
266
/* Short Audio Descriptor */
267
int total_short_audio_desc;
268
cea_audio_format_t *short_audio_desc;
269
/* Vendor Descriptor Block */
270
unsigned char *vendor_data_block;
272
unsigned char audio_flag; /* Define is ELD status */
276
audio_capability_t audio_cap[3]; /* Panel audio capability (48,96,192)Khz*/
278
/* AVI Info frames data */
279
int pixel_rep; /* Pixel replication */
280
int quantization; /* Quantization */
281
int aspect_ratio; /* Aspect Ratio */
282
int colorimetry; /* Colorimetry */
284
/* Consolidate ELD information here */
286
unsigned char eld_ptr[256];
289
unsigned char version;
291
unsigned char cea_ver: 3;
292
unsigned char eld_ver: 5;
296
unsigned char capability;
298
unsigned char hdcp: 1;
299
unsigned char repeater: 1;
300
unsigned char _44ms: 1;
301
unsigned char reserved1: 5;
305
unsigned short length;
307
unsigned short mnl: 3;
308
unsigned short vsdbl: 3;
309
unsigned short sadc: 4;
310
unsigned short reserved2: 6;
313
unsigned short manu_id;
314
unsigned short prod_id;
315
unsigned char LPCM_CAD[3]; /* LPCM for ELD */
316
unsigned char speaker_alloc_block[3];
317
vsdb_t vendor_block; /* 13 byte */
318
unsigned char misc_data[229];
323
/* Following are the callback functions provided to port driver. It also
324
* provides a call back context. Every time port driver has to pass this
325
* callback context when calling a callback function.
327
* read_regs: Port driver has to pass a list of pd_reg_t's which
328
* it want to read. The list has to end with PD_I2C_LIST_END.
329
* The values read will be set to the for every list->reg,
330
* value will be set in list->value.
332
* Return value == 0 on success
335
* write_regs: Port driver has to pass a list of pd_reg_t's which
336
* it want to write. The list has to end with PD_LIST_END.
337
* Caller has to provide already masked values. This callback
338
* function doesn't do any masking. If, port driver wants to
339
* write only some bits of a reg, first it has to read the
340
* register and then set bits and write the register.
342
* Return value == 0 on success
346
#define PD_REG_I2C 0x00000001
347
#define PD_REG_LPC 0x00000002
348
#define PD_REG_DMA 0x00000003
349
#define PD_REG_PCI 0x00000004
350
#define PD_REG_MIO 0x00000005 /* MMIO 32 bits */
351
#define PD_REG_PIO8 0x00000006 /* Port IO 1 byte */
352
#define PD_REG_PIO16 0x00000007 /* Port IO 2 bytes */
353
#define PD_REG_PIO32 0x00000008 /* Port IO 4 bytes */
354
#define PD_REG_MIO8 0x00000009 /* MMIO 8 bits */
355
#define PD_REG_BRIDGE_OPCODE 0x0000000D /* Host bridge read and write */
356
#define PD_REG_DDC 0x0000000E /* Read the ddc */
358
typedef int (*pd_read_regs_p)(void *callback_context, pd_reg_t *list,
360
typedef int (*pd_write_regs_p)(void *callback_context, pd_reg_t *list,
363
typedef struct _pd_callback {
364
void *callback_context;
365
pd_read_regs_p read_regs;
366
pd_write_regs_p write_regs;
367
unsigned long port_num; /* Added for SDVO port driver */
368
cea_extension_t **eld; /* EDID like Data */
371
/* IMP NOTE: All below structures should be with same size.
372
* pd_attr_t : General attribute structure
373
* pd_range_attr_t : Range type attribute structure
374
* pd_list_attr_t : List type attribute
375
* pd_list_entry_attr_t : Entry for a list
376
* pd_bool_attr_t : Boolean type attribute
377
* pd_buffer_attr_t : Buffer type attribute
379
typedef igd_attr_t pd_attr_t;
380
typedef igd_range_attr_t pd_range_attr_t;
381
typedef igd_list_attr_t pd_list_attr_t;
382
typedef igd_list_entry_attr_t pd_list_entry_attr_t;
383
typedef igd_bool_attr_t pd_bool_attr_t;
384
typedef igd_buffer_attr_t pd_buffer_attr_t;
386
#define ATTR(a) ((pd_attr_t *)a) /* General attr */
387
#define RATTR(a) ((pd_range_attr_t *)a) /* Range attr */
388
#define LHATTR(a) ((pd_list_attr_t *)a) /* List head attr */
389
#define LEATTR(a) ((pd_list_entry_attr_t *)a) /* List entry attr */
390
#define BATTR(a) ((pd_bool_attr_t *)a) /* Bool attr */
391
#define BUATTR(a) ((pd_buffer_attr_t *)a) /* Buffer attr */
393
/* Timing structure flag defines */
394
#define PD_SCAN_INTERLACE 0x80000000
395
#define PD_LINE_DOUBLE 0x40000000
396
#define PD_PIXEL_DOUBLE 0x20000000
397
#define PD_MODE_TEXT 0x10000000 /* VGA Text mode */
399
#define PD_HSYNC_HIGH 0x08000000
400
#define PD_VSYNC_HIGH 0x04000000
401
#define PD_BLANK_LOW 0x02000000
402
#define PD_MODE_VESA 0x01000000 /* VGA/VESA mode number is valid */
404
#define PD_MODE_STALL 0x00800000 /* Flag to enable stall signal */
405
#define PD_MODE_SCALE 0x00400000 /* Request NATIVE timings */
407
#define PD_ASPECT_16_9 0x00200000 /* 16:9 aspect ratio, otherwise it is 4:3 */
408
#define PD_MODE_CEA 0x00100000
410
#define PD_MODE_DTD 0x00080000 /* Read from EDID */
411
#define PD_MODE_DTD_USER 0x00040000 /* User defined timing */
412
#define PD_MODE_DTD_FP_NATIVE 0x00020000 /* Native fp timing */
413
#define PD_MODE_SUPPORTED 0x00010000
415
#define PD_MODE_FACTORY 0x00008000 /* Factory supported mode */
416
#define PD_MODE_RB 0x00004000 /* Reduced blanking mode */
418
/* Macro to put at the end timing table */
419
#define PD_TIMING_TABLE_END \
421
PD_TIMING_LIST_END, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
425
/* Timing structure */
426
typedef struct _pd_timing {
427
unsigned short width; /* width */
428
unsigned short height; /* height */
429
unsigned short refresh; /* refresh rate */
430
unsigned long dclk; /* refresh rate dot clock in kHz */
431
unsigned short htotal; /* horizontal total */
432
unsigned short hblank_start; /* horizontal blank start */
433
unsigned short hblank_end; /* horizontal blank end */
434
unsigned short hsync_start; /* horizontal sync start */
435
unsigned short hsync_end; /* horizontal sync end */
436
unsigned short vtotal; /* vertical total */
437
unsigned short vblank_start; /* vertical blank start */
438
unsigned short vblank_end; /* vertical blank end */
439
unsigned short vsync_start; /* vertical sync start */
440
unsigned short vsync_end; /* vertical sync end */
441
short mode_number; /* VGA or VESA mode number */
442
unsigned long mode_info_flags; /* Valid Flags
450
unsigned short x_offset;
451
unsigned short y_offset;
452
void *extn_ptr; /* INTERNAL pointer for use by main driver only */
453
unsigned short reserved_dd; /* Reserved for device dependant layer */
454
unsigned short reserved_dd_ext; /* Reserved for device dependant layer */
457
/* Bit field flags for pd_driver_t->driver_flags */
458
#define PD_FLAG_GANG_MODE 0x00000001 /* driver is running in gang mode*/
459
#define PD_FLAG_CLK_SOURCE 0x00000002 /* clk source is port driver */
460
#define PD_FLAG_PIPE_MASTER 0x00000004 /* master port driver */
461
#define PD_FLAG_REV_DATA_ORDER 0x00000008 /* reverse data order requested */
462
#define PD_FLAG_I740_DATA_ORDER 0x00000010 /* For I740 Data ordering. If this
463
flag isn't set, then it is
464
Flat panel data ordering */
465
#define PD_FLAG_DUAL_DVO 0x00000020 /* Same port driver will be loaded
466
* on both DVOB & DVOC with same
468
#define PD_FLAG_GANG_MODE_EVEN_ODD 0x00000040 /* pd wants gang mode in even
469
* pixels on one DVO port &
470
* odd pixels on other DVO port.
471
* Default is upper half pixel
472
* on one DVO port and lower
473
* half on the other DVO port.
475
#define PD_FLAG_UP_SCALING 0x00000080 /* pd supports up-scaling */
476
#define PD_FLAG_DOWN_SCALING 0x00000100 /* pd supports down-scaling */
477
#define PD_FLAG_CLOCK_MASTER 0x00000200 /* clock master port driver */
478
#define PD_FLAG_GANG_MODE_DVOCLKINV 0x00000400 /* GangMode DVO Clk inversion */
479
#define PD_FLAG_NO_VGA_2X_IMAGE 0x00000800 /* Gang Mode operation might
480
* request this flag */
482
/* Flag for set_mode function */
483
/* Though these are bit fields, both cannot be used at same time */
484
#define PD_SET_MODE_PIPE_A 0x1
485
#define PD_SET_MODE_PIPE_B 0x2
486
#define PD_SET_MODE_FLAG_TEST 0x4
488
/* Flags for save and restore */
489
#define PD_NO_RESTORE_FREE_STATE 0x1
492
#define PD_POWER_MODE_D0 0x0
493
#define PD_POWER_MODE_D1 0x1
494
#define PD_POWER_MODE_D2 0x2
495
#define PD_POWER_MODE_D3 0x3
497
#define PD_FILE_SIZE 8 /* File name size for port driver excluding
498
* extension. Extension can be max of 3 chars. */
500
/* Following is the abstraction of port driver. Port driver passes this
501
* driver information to display driver as part of registering itself with
502
* display driver. pd_register(pd_driver_t *) is called from port driver
503
* in its init function which is called whenever port driver is loaded.
505
* Port driver provides following list of functions to display driver.
506
* Display driver calls these functions to do the required operations.
508
* type - supporting display type for the port driver
510
* flags - flags for the driver. And cannot be changed at runtime.
511
* Once these flags are passed to main driver, they will be
512
* used while setting the mode.
514
* context - Driver's contextual information. The driver can save
515
* all needed state information in this opaque pointer
516
* such that the driver is entirely reentrant. No writeable
517
* data may be saved in any non-stack variables by a driver
518
* therefore all necessary data must be saved in a private
519
* structure and stored in this pointer. This pointer is
520
* passed to the driver with each function call.
522
* validate - Display driver calls this function to validate the port
523
* driver by passing a magic cookie. Port driver does some
524
* magic operation and returns another cookie back to caller.
525
* If the returned cookie has correct value then the driver
526
* passes the validation, otherwise driver cannot communicate
527
* with display driver.
529
* open - This function is to detect for any port device (codec).
530
* pd_callback_t has all the required callback functions
531
* to do this operation.
533
* init_device - This function detects and initializes any display devices
534
* attached to the codec.
536
* For ex: a multi function encoder can support a FlatPanel or
537
* TVout display. It has to detect and check for any
538
* Flatpanel or TVout display device attached, then it
539
* initializes the display devices.
541
* pd_close - closes the display device and frees any memory allocated.
543
* set_mode - sets/tests a mode. Display (or main) driver calls this
544
* function to set a mode when the encoder in D3 power state.
545
* At this time, DVO timings are off.
546
* If encoder wants to run setmode in any other power state,
547
* then first thing it needs to do is enter into that power
548
* state and then do setmode.
550
* When this function returns it is expected that:
551
* 1. Either encoder is in D0 power state or
552
* it defers until post_set_mode().
553
* 2. In case of external encoder (example: TVOut encoder)
554
* driving the reference clock, the clock is running.
556
* post_set_mode- This is called after GMCH DVO timings are on.
557
* This function can be null if there is nothing to do.
558
* This is used to do any post processing on the encoder
559
* after GMCH starts driving the timings. When this function
560
* returns it is expected that the encoder is in D0 power state.
562
* context - port driver context
563
* mode - current timing
564
* flags - not used (for future use).
566
* set_attrs - to set provided list of attributes.
568
* get_attrs - to get list of attributes.
570
* get_timing_list - returns the list of supported modes for the current
571
* attributes. For example if the TVFormat is NTSC, this
572
* function will return only the modes supported for NTSC.
574
* set_power - to set the power state of the display device.
576
* get_power - to get the current power state of the display device.
578
* pd_save - to save the current state of the registers.
579
* - returns the current state in the double pointer 'state'.
581
* pd_restore - to restore to the passed state. This functions frees the
582
* resources allocated that state.
583
* - pass the previously saved state in 'state'.
585
* If PD_NO_RESTORE_FREE_STATE is set, then it just frees
586
* the resources without restoring the state.
588
* pd_get_port_status - to get the status of port/display
591
* All functions return value:
597
/* Note on version AA.BB.CC.DD
600
* CC - Patch version if any
601
* DD - Bug fixes if any
603
* 01.00.00.00 is the first initial major version */
604
typedef struct _pd_version {
608
unsigned char bug_fix;
613
PD_DISP_STATUS_DETACHED = 0, /* Display is not connected */
614
PD_DISP_STATUS_ATTACHED, /* Display is connected */
615
PD_DISP_STATUS_UNKNOWN /* Unable to determine */
616
} pd_display_status_t;
618
/* Port/Display information */
619
typedef struct _pd_port_status {
620
pd_display_status_t connected; /* Display status */
621
unsigned long display_type; /* Type of display, if connected */
624
typedef struct _pd_driver {
625
unsigned long pd_sdk_version; /* PD SDK version - interface ver */
626
char name[PD_NAME_SIZE]; /* Descriptive name of port driver */
627
char num_devices; /* Number of devices it is driving */
628
pd_version_t *version; /* Driver version */
631
unsigned long *dab_list; /* PD_DAB_LIST_END terminated list */
632
unsigned long i2c_speed; /* Encoder I2C speed in KHz */
633
unsigned long (*validate)(unsigned long cookie);
634
int (*open) (pd_callback_t *callback, void **context);
635
int (*init_device)(void *context);
636
int (*pd_close) (void *context);
637
int (*set_mode) (void *context, pd_timing_t *mode, unsigned long flags);
638
int (*post_set_mode)(void *context, pd_timing_t *mode, unsigned long flags);
639
int (*set_attrs) (void *context, unsigned long num, pd_attr_t *list);
640
int (*get_attrs) (void *context, unsigned long *num, pd_attr_t **list);
641
int (*get_timing_list)(void*context,pd_timing_t*in_list,pd_timing_t**list);
642
int (*set_power) (void *context, unsigned long state);
643
int (*get_power) (void *context, unsigned long *state);
644
int (*pd_save) (void *context, void **state, unsigned long flags);
645
int (*pd_restore) (void *context, void *state, unsigned long flags);
646
int (*pd_get_port_status) (void *context, pd_port_status_t *port_status);
649
/* Mode filter helper function for port drivers */
650
/* Structure representing encoder capabilities for mode filtering */
651
typedef struct _pd_dvo_info {
652
unsigned long min_dclk; /* Min clock */
653
unsigned long max_dclk; /* Max clock */
654
unsigned char upscale; /* Is upscalable? */
655
unsigned char downscale; /* Is downscalable? */
656
unsigned short upscale_min_width; /* Min upscale width */
657
unsigned short upscale_min_height; /* Min upscale height */
658
unsigned short downscale_max_width; /* Max downscale width */
659
unsigned short downscale_max_height; /* Max downscale height */
662
typedef struct _pd_display_info {
663
unsigned char panel_fit; /* Incoming */
664
unsigned char fixed_res; /* Outgoing */
665
unsigned short width; /* Outgoing */
666
unsigned short height; /* Outgoing */
667
pd_timing_t *native_dtd; /* Outgoing */
670
/* All following functions are provided to port drivers as a binary file.
672
* pd_register: This function is called by port driver to register with
673
* display driver. It passes its driver structure to display
676
* pd_malloc: This function is used to allocate any dynamic memory required
677
* in port driver. Port driver will pass the size of the memory
678
* it is requesting in bytes.
680
* Return value == pointer to the allocated memory on success
681
* == NULL if failed to allocated the memory
683
* pd_memset: This function is used to set the passed byte in memory
686
* pd_memcpy: This function is used to copy size bytes from src pointer to
689
* free: This function is used to free the memory previously allocated
690
* using malloc callback function.
692
* usleep: This function is used to get any delay in port driver.
693
* 'usec' is specified in micro seconds.
696
* ui_usleep: This function is used to get any delay in port driver uniterrupted.
697
* 'usec' is specified in micro seconds.
701
* printf: This function is used to do any debug prints for port driver.
702
* This has exactly the same syntax and usage of standard
705
* strcpy: This function is used to copy src string into dest string.
706
* This has exactly the same syntax and usage of standard
709
* filter: This function is to filter the incoming mode list based on
710
* dvo_info. Memory is allocated for outgoing list. No changes
713
int pd_register(void *handle, pd_driver_t *driver);
714
void *pd_malloc(unsigned long size);
715
void *pd_memset(void *address, int c, unsigned long size);
716
void *pd_memcpy(void *dst, void *src, unsigned long size);
717
void pd_free (void *address);
719
void pd_usleep(unsigned long usec);
720
void pd_ui_usleep(unsigned long usec);
721
char *pd_strcpy(char *dest, char const *src);
722
int *pd_printf(const char *format, ...);
723
int pd_check_attr(pd_attr_t *curr, pd_attr_t *in);
724
/* Mode filter helper function for port drivers */
725
int pd_filter_timings(void *context, pd_timing_t *inlist, pd_timing_t **olist,
726
pd_dvo_info_t *dvo_info, pd_display_info_t *display_info);
728
/* pd_get_attr() : To return the request attr from the list.
729
* In case of 'attr_id' is a list type attribute, then caller
730
* can request either LIST head itself or list entry for that
732
#define PD_GET_ATTR_LIST 0x0001
733
#define PD_GET_ATTR_LIST_ENTRY 0x0002
734
pd_attr_t *pd_get_attr(pd_attr_t *attr_list, unsigned long num_attrs,
735
unsigned long attr_id, unsigned long flag);
739
typedef int (*pd_register_p) (void *handle, pd_driver_t *driver);
740
typedef void *(*pd_malloc_p)(unsigned long size);
741
typedef void *(*pd_memset_p)(void *address, int c, unsigned long size);
742
typedef void *(*pd_memcpy_p)(void *dst, void *src, unsigned long size);
743
typedef void (*pd_free_p) (void *address);
744
typedef void (*pd_usleep_p)(unsigned long usec);
745
typedef char *(*pd_strcpy_p)(char *dest, char const *src);
746
typedef int *(*pd_printf_p)(const char *format, ...);
747
typedef int (*pd_check_attr_p)(pd_attr_t *curr, pd_attr_t *in);
748
typedef pd_attr_t *(*pd_get_attr_p)(pd_attr_t *attr_list,
749
unsigned long num_attrs, unsigned long attr_id, unsigned long flag);
750
typedef emgd_debug_t *(*pd_get_emgd_debug_p)( void );
751
typedef unsigned long *(*pd_get_dropped_debug_messages_p)( void );
752
typedef void *(*pd_get_debug_log_mutex_p)( void );
754
// Mode filter helper function for port drivers
755
typedef int (*pd_filter_timings_p)(void *context, pd_timing_t *inlist,
756
pd_timing_t **olist, pd_dvo_info_t *dvo_info,
757
pd_display_info_t *display_info);
761
/*----------------------------------------------------------------------------
762
* File Revision History
763
* $Id: pd.h,v 1.7 2010/07/23 16:54:50 bpaauwe Exp $
764
* $Source: /nfs/fm/proj/eia/cvsroot/koheo/linux/egd_drm/emgd/include/pd.h,v $
765
*----------------------------------------------------------------------------