The Radeon driver should now support returning EDID information as well - not

yet tested, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22585 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-10-15 23:53:57 +00:00
parent 3dd4843b9d
commit 9ee4f3c805
3 changed files with 66 additions and 38 deletions
@@ -1,14 +1,13 @@
/* /*
Copyright (c) 2002, Thomas Kurschel * Copyright (c) 2002, Thomas Kurschel
* Distributed under the terms of the MIT License.
*/
Part of Radeon accelerant /*!
Contains entry point to get public functions. Contains entry point to get public functions.
(directly copied from sample driver) (directly copied from sample driver)
*/ */
#include "generic.h" #include "generic.h"
/* /*
@@ -22,9 +21,11 @@ is available. Any extra information available to choose the function will be
noted on a case by case below. noted on a case by case below.
*/ */
void * get_accelerant_hook(uint32 feature, void *data) { void *
get_accelerant_hook(uint32 feature, void *data)
{
(void)data; (void)data;
switch (feature) { switch (feature) {
/* /*
These definitions are out of pure lazyness. These definitions are out of pure lazyness.
@@ -59,6 +60,8 @@ initialization process.
HOOK(MOVE_DISPLAY); HOOK(MOVE_DISPLAY);
HOOK(SET_INDEXED_COLORS); HOOK(SET_INDEXED_COLORS);
//HOOK(GET_TIMING_CONSTRAINTS); //HOOK(GET_TIMING_CONSTRAINTS);
case B_GET_EDID_INFO:
return (void*)radeon_get_edid_info;
HOOK(DPMS_CAPABILITIES); HOOK(DPMS_CAPABILITIES);
HOOK(DPMS_MODE); HOOK(DPMS_MODE);
@@ -103,8 +106,6 @@ the same function all the time.
#undef HOOK #undef HOOK
#undef ZERO #undef ZERO
} }
/*
Return a null pointer for any feature we don't understand. return NULL;
*/
return 0;
} }
+53 -27
View File
@@ -1,52 +1,52 @@
/* /*
Copyright (c) 2002, Thomas Kurschel * Copyright (c) 2002, Thomas Kurschel
* Distributed under the terms of the MIT License.
*/
Part of Radeon accelerant /*! Public mode-specific info functions */
Public mode-specific info functions
*/
#include "radeon_accelerant.h" #include "radeon_accelerant.h"
#include "GlobalData.h" #include "GlobalData.h"
#include "generic.h" #include "generic.h"
#include <GraphicsDefs.h> #include <GraphicsDefs.h>
// public function: return current display mode status_t
status_t GET_DISPLAY_MODE( display_mode *current_mode ) GET_DISPLAY_MODE(display_mode *mode)
{ {
virtual_card *vc = ai->vc; virtual_card *vc = ai->vc;
// TBD: there is a race condition if someone else is just setting it // TBD: there is a race condition if someone else is just setting it
// we won't lock up but return non-sense // we won't lock up but return non-sense
*current_mode = vc->mode; *mode = vc->mode;
// we hide multi-monitor-mode because :- // we hide multi-monitor-mode because :-
// - we want to look like an ordinary single-screen driver // - we want to look like an ordinary single-screen driver
// - the multi-mode is already adapted to current screen configuration, // - the multi-mode is already adapted to current screen configuration,
// and the mode should be configuration-independant // and the mode should be configuration-independant
Radeon_HideMultiMode( vc, current_mode ); Radeon_HideMultiMode(vc, mode);
return B_OK; return B_OK;
} }
// public function: return configuration of frame buffer
status_t GET_FRAME_BUFFER_CONFIG( frame_buffer_config *afb ) status_t
GET_FRAME_BUFFER_CONFIG(frame_buffer_config *afb)
{ {
virtual_card *vc = ai->vc; virtual_card *vc = ai->vc;
// TBD: race condition again // TBD: race condition again
// easy again, as the last mode set stored the info in a convienient form // easy again, as the last mode set stored the info in a convienient form
*afb = vc->fbc; *afb = vc->fbc;
return B_OK; return B_OK;
} }
// public function: return clock limits for given display mode
status_t GET_PIXEL_CLOCK_LIMITS(display_mode *dm, uint32 *low, uint32 *high) status_t
GET_PIXEL_CLOCK_LIMITS(display_mode *dm, uint32 *low, uint32 *high)
{ {
// we ignore stuff like DVI/LCD restrictions - // we ignore stuff like DVI/LCD restrictions -
// they are handled automatically on set_display_mode // they are handled automatically on set_display_mode
@@ -62,11 +62,38 @@ status_t GET_PIXEL_CLOCK_LIMITS(display_mode *dm, uint32 *low, uint32 *high)
return B_OK; return B_OK;
} }
#ifdef __HAIKU__
status_t
radeon_get_edid_info(void* info, size_t size, uint32* _version)
{
disp_entity* routes = &ai->si->routing;
int32 index;
if (size < sizeof(struct edid1_info))
return B_BUFFER_OVERFLOW;
if (routes->port_info[0].edid_valid)
index = 0;
else if (routes->port_info[1].edid_valid)
index = 1;
else
return B_ERROR;
memcpy(info, &routes->port_info[index].edid, sizeof(struct edid1_info));
*_version = EDID_VERSION_1;
return B_OK;
}
#endif // __HAIKU__
/* /*
Return the semaphore id that will be used to signal a vertical retrace Return the semaphore id that will be used to signal a vertical retrace
occured. occured.
*/ */
sem_id ACCELERANT_RETRACE_SEMAPHORE(void) sem_id
ACCELERANT_RETRACE_SEMAPHORE(void)
{ {
virtual_card *vc = ai->vc; virtual_card *vc = ai->vc;
@@ -80,15 +107,14 @@ sem_id ACCELERANT_RETRACE_SEMAPHORE(void)
// with multi-monitor mode, we have two vertical blanks! // with multi-monitor mode, we have two vertical blanks!
// until we find a better solution, we always return virtual port 0, // until we find a better solution, we always return virtual port 0,
// which may be either physical port 0 or 1 // which may be either physical port 0 or 1
int crtc_idx; int crtcIndex;
if( vc->used_crtc[0] ) if( vc->used_crtc[0] )
crtc_idx = 0; crtcIndex = 0;
else else
crtc_idx = 1; crtcIndex = 1;
//SHOW_INFO( 3, "semaphore: %x", ai->si->ports[physical_port].vblank ); //SHOW_INFO( 3, "semaphore: %x", ai->si->ports[physical_port].vblank );
return ai->si->crtc[crtc_idx].vblank; return ai->si->crtc[crtcIndex].vblank;
//return B_ERROR;
} }
+1
View File
@@ -27,6 +27,7 @@ status_t GET_PIXEL_CLOCK_LIMITS(display_mode *dm, uint32 *low, uint32 *high);
status_t MOVE_DISPLAY(uint16 h_display_start, uint16 v_display_start); status_t MOVE_DISPLAY(uint16 h_display_start, uint16 v_display_start);
status_t GET_TIMING_CONSTRAINTS(display_timing_constraints *dtc); status_t GET_TIMING_CONSTRAINTS(display_timing_constraints *dtc);
void SET_INDEXED_COLORS(uint count, uint8 first, uint8 *color_data, uint32 flags); void SET_INDEXED_COLORS(uint count, uint8 first, uint8 *color_data, uint32 flags);
status_t radeon_get_edid_info(void* info, size_t size, uint32* _version);
uint32 DPMS_CAPABILITIES(void); uint32 DPMS_CAPABILITIES(void);
uint32 DPMS_MODE(void); uint32 DPMS_MODE(void);