Commit b2421153 authored by ROOL's avatar ROOL :robot:
Browse files

Non code changes

Admin:
  Line up braces missed in earlier tidying.
  Not tagged.
parent ea866f88
...@@ -143,15 +143,17 @@ static _kernel_oserror *generate_dmt_mode(char dmt, MonitorDescriptionRef monito ...@@ -143,15 +143,17 @@ static _kernel_oserror *generate_dmt_mode(char dmt, MonitorDescriptionRef monito
return 0; return 0;
} }
static _kernel_oserror *Check_EDID_Checksum(EDIDBlockRef edidblock, bool checkall) static _kernel_oserror *check_edid_checksum(EDIDBlockRef edidblock, bool checkall)
{ {
_kernel_oserror *res = NULL; _kernel_oserror *res = NULL;
size_t byte, block, blocks_to_check = 0; size_t byte, block, blocks_to_check = 0;
for (block = 0; block <= blocks_to_check; block++) { for (block = 0; block <= blocks_to_check; block++)
{
uint8_t count = 0; uint8_t count = 0;
uint8_t *ediddata = (uint8_t *)&edidblock[block]; uint8_t *ediddata = (uint8_t *)&edidblock[block];
for (byte = 0; byte < sizeof(EDIDBlock); byte++) { for (byte = 0; byte < sizeof(EDIDBlock); byte++)
{
count = count + ediddata[byte]; count = count + ediddata[byte];
} }
if (count != 0) if (count != 0)
...@@ -702,7 +704,7 @@ static _kernel_oserror *generate_standard_timing(char std1, char std2, MonitorDe ...@@ -702,7 +704,7 @@ static _kernel_oserror *generate_standard_timing(char std1, char std2, MonitorDe
*/ */
int i = 0; int i = 0;
IFDEBUG printf("Standard Timing(%x %x) ", std1, std2); IFDEBUG printf("Standard Timing (%x %x) ", std1, std2);
while (std_timings[i].stdcode[0] || std_timings[i].stdcode[1]) while (std_timings[i].stdcode[0] || std_timings[i].stdcode[1])
{ {
...@@ -789,7 +791,7 @@ static _kernel_oserror *generate_cvt3_timing(char cvt1, char cvt2, char cvt3, Mo ...@@ -789,7 +791,7 @@ static _kernel_oserror *generate_cvt3_timing(char cvt1, char cvt2, char cvt3, Mo
/* If this mode is defined as a DMT standard, use this by checking the /* If this mode is defined as a DMT standard, use this by checking the
* bytes directly with the lookup table * bytes directly with the lookup table
*/ */
IFDEBUG printf("CVT 3-byte Timing(%x %x %x) ", cvt1, cvt2, cvt3); IFDEBUG printf("CVT 3-byte Timing (%x %x %x) ", cvt1, cvt2, cvt3);
/* Check the reserved bits are 00. If not, let this mode fail silently */ /* Check the reserved bits are 00. If not, let this mode fail silently */
if ((cvt2 & 0x03) != 0) if ((cvt2 & 0x03) != 0)
...@@ -884,7 +886,7 @@ static _kernel_oserror *generate_cvt3_timing(char cvt1, char cvt2, char cvt3, Mo ...@@ -884,7 +886,7 @@ static _kernel_oserror *generate_cvt3_timing(char cvt1, char cvt2, char cvt3, Mo
{ {
return error(ERR_NOSPACE, 0, 0, 0); return error(ERR_NOSPACE, 0, 0, 0);
} }
IFDEBUG printf("\nAt %x Hz(calculated):\n", freq); IFDEBUG printf("\nAt %x Hz (calculated):\n", freq);
generate_mode_using_cvt_rb(xres, yres, freq, mode_desc, monitor); generate_mode_using_cvt_rb(xres, yres, freq, mode_desc, monitor);
if (add_proposed_mode(monitor, mode_desc) == 0) if (add_proposed_mode(monitor, mode_desc) == 0)
{ {
...@@ -1322,7 +1324,8 @@ static _kernel_oserror *process_vtb_extension_block(EDIDExtensionBlockRef ext_bl ...@@ -1322,7 +1324,8 @@ static _kernel_oserror *process_vtb_extension_block(EDIDExtensionBlockRef ext_bl
return NULL; return NULL;
} }
/* Unused bytes should be zero */ /* Unused bytes should be zero */
for (int byte = 0x5 + w*0x12 + y*0x3 + z*0x2; byte < 127; byte++) { for (int byte = 0x5 + w*0x12 + y*0x3 + z*0x2; byte < 127; byte++)
{
if (extdata[byte]) if (extdata[byte])
{ {
return NULL; return NULL;
...@@ -1363,8 +1366,8 @@ static _kernel_oserror *process_vtb_extension_block(EDIDExtensionBlockRef ext_bl ...@@ -1363,8 +1366,8 @@ static _kernel_oserror *process_vtb_extension_block(EDIDExtensionBlockRef ext_bl
int cvt_byte = 0x5 + w*0x12 + cvt_blockno*0x3; int cvt_byte = 0x5 + w*0x12 + cvt_blockno*0x3;
if (!((extdata[cvt_byte] == 0) && if (!((extdata[cvt_byte] == 0) &&
(extdata[cvt_byte+1] == 0) && (extdata[cvt_byte+1] == 0) &&
(extdata[cvt_byte+2] == 0))) { (extdata[cvt_byte+2] == 0)))
{
res = generate_cvt3_timing(extdata[cvt_byte], extdata[cvt_byte+1], extdata[cvt_byte+2], new_monitor); res = generate_cvt3_timing(extdata[cvt_byte], extdata[cvt_byte+1], extdata[cvt_byte+2], new_monitor);
if (res) if (res)
{ {
...@@ -1383,8 +1386,8 @@ static _kernel_oserror *process_vtb_extension_block(EDIDExtensionBlockRef ext_bl ...@@ -1383,8 +1386,8 @@ static _kernel_oserror *process_vtb_extension_block(EDIDExtensionBlockRef ext_bl
} }
int std_byte = 0x5 + w*0x12 + y*0x3 + std_blockno*0x2; int std_byte = 0x5 + w*0x12 + y*0x3 + std_blockno*0x2;
if (!((extdata[std_byte] == 0x1) && if (!((extdata[std_byte] == 0x1) &&
(extdata[std_byte+1] == 0x1))) { (extdata[std_byte+1] == 0x1)))
{
res = generate_standard_timing(extdata[std_byte], extdata[std_byte+1], new_monitor); res = generate_standard_timing(extdata[std_byte], extdata[std_byte+1], new_monitor);
if (res) if (res)
{ {
...@@ -1448,7 +1451,7 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file) ...@@ -1448,7 +1451,7 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file)
else{ else{
if ((edidblockref->feature_support & 1) == 1) if ((edidblockref->feature_support & 1) == 1)
{ {
printf("This display supports continuous frequency modes(but we don't use this yet\n"); printf("This display supports continuous frequency modes (but we don't use this yet\n");
} }
else else
{ {
...@@ -1571,7 +1574,8 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file) ...@@ -1571,7 +1574,8 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file)
{ {
if (!((edidblockref->data_block[blockno][cvt_byte] == 0) && if (!((edidblockref->data_block[blockno][cvt_byte] == 0) &&
(edidblockref->data_block[blockno][cvt_byte+1] == 0) && (edidblockref->data_block[blockno][cvt_byte+1] == 0) &&
(edidblockref->data_block[blockno][cvt_byte+2] == 0))) { (edidblockref->data_block[blockno][cvt_byte+2] == 0)))
{
res = generate_cvt3_timing( res = generate_cvt3_timing(
edidblockref->data_block[blockno][cvt_byte], edidblockref->data_block[blockno][cvt_byte],
edidblockref->data_block[blockno][cvt_byte+1], edidblockref->data_block[blockno][cvt_byte+1],
...@@ -1677,11 +1681,13 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file) ...@@ -1677,11 +1681,13 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file)
} }
if ((timing_support == EDID_USE_GTF) || if ((timing_support == EDID_USE_GTF) ||
(timing_support == EDID_USE_GTF2)) { (timing_support == EDID_USE_GTF2))
{
generate_mode_using_gtf(xres, yres, freq, mp, new_monitor); generate_mode_using_gtf(xres, yres, freq, mp, new_monitor);
} }
if ((timing_support == EDID_USE_CVT) || if ((timing_support == EDID_USE_CVT) ||
(timing_support == EDID_USE_CVTRB)) { (timing_support == EDID_USE_CVTRB))
{
generate_mode_using_cvt_rb(xres, yres, freq, mp, new_monitor); generate_mode_using_cvt_rb(xres, yres, freq, mp, new_monitor);
} }
} }
...@@ -1793,7 +1799,8 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file) ...@@ -1793,7 +1799,8 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file)
fprintf(f,"# Uses %s frequency pixel clocks\n", ((edidblockref->feature_support & 1) == 1)?"Continuous":"Specific"); fprintf(f,"# Uses %s frequency pixel clocks\n", ((edidblockref->feature_support & 1) == 1)?"Continuous":"Specific");
char *rules="unknown"; char *rules="unknown";
switch (timing_support) { switch (timing_support)
{
case EDID_USE_CVT:rules="CVT";break; case EDID_USE_CVT:rules="CVT";break;
case EDID_USE_DMT:rules="DMT";break; case EDID_USE_DMT:rules="DMT";break;
case EDID_USE_CVTRB:rules="CVTRB";break; case EDID_USE_CVTRB:rules="CVTRB";break;
...@@ -1808,7 +1815,8 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file) ...@@ -1808,7 +1815,8 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file)
fprintf(f,"DPMS_state:%d\n",new_monitor->dpms_state); fprintf(f,"DPMS_state:%d\n",new_monitor->dpms_state);
} }
ModeDescriptionRef this = new_monitor->modelist; ModeDescriptionRef this = new_monitor->modelist;
do { do
{
fprintf(f,"\n# Mode: %d x %d @ %dHz",this->definition.xres,this->definition.yres,this->frame_hz); fprintf(f,"\n# Mode: %d x %d @ %dHz",this->definition.xres,this->definition.yres,this->frame_hz);
fprintf(f,"\n# Bounds: H %3.2fkHz, V %3.2f, DClock %3.2fMHz",((float)(this->line_hz))/1000.0f,((float)(this->frame_mhz))/1000.0f,((float)(this->definition.pixel_khz))/1000.0f); fprintf(f,"\n# Bounds: H %3.2fkHz, V %3.2f, DClock %3.2fMHz",((float)(this->line_hz))/1000.0f,((float)(this->frame_mhz))/1000.0f,((float)(this->definition.pixel_khz))/1000.0f);
fprintf(f,"\nstartmode"); fprintf(f,"\nstartmode");
...@@ -1828,7 +1836,8 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file) ...@@ -1828,7 +1836,8 @@ static _kernel_oserror *parseedid(char *ediddata, const char *file)
} while (this); } while (this);
/* now fo hex dump of EDID block */ /* now fo hex dump of EDID block */
fprintf(f,"# EDID block dump\n#\n"); fprintf(f,"# EDID block dump\n#\n");
for (int i=0; i<(edidblockref->extension_block_count+1)*0x80;i+=16) { for (int i=0; i<(edidblockref->extension_block_count+1)*0x80;i+=16)
{
fprintf(f,"# %02x %02x %02x %02x %02x %02x %02x %02x", fprintf(f,"# %02x %02x %02x %02x %02x %02x %02x %02x",
ediddata[i],ediddata[i+1],ediddata[i+2],ediddata[i+3], ediddata[i],ediddata[i+1],ediddata[i+2],ediddata[i+3],
ediddata[i+4],ediddata[i+5],ediddata[i+6],ediddata[i+7]); ediddata[i+4],ediddata[i+5],ediddata[i+6],ediddata[i+7]);
...@@ -1956,7 +1965,7 @@ _kernel_oserror *loadedid(const char *file) ...@@ -1956,7 +1965,7 @@ _kernel_oserror *loadedid(const char *file)
/* Check the block is valid */ /* Check the block is valid */
if (!res) if (!res)
{ {
res = Check_EDID_Checksum((EDIDBlockRef)edidblock, true); res = check_edid_checksum((EDIDBlockRef)edidblock, true);
} }
if (!res) if (!res)
{ {
...@@ -1982,7 +1991,7 @@ _kernel_oserror *readedid(int displaynum, const char *file) ...@@ -1982,7 +1991,7 @@ _kernel_oserror *readedid(int displaynum, const char *file)
/* Check the block is valid */ /* Check the block is valid */
if (!res) if (!res)
{ {
res = Check_EDID_Checksum(edidblock, false); res = check_edid_checksum(edidblock, false);
} }
/* Now use a separate pointer to the block for extending it and /* Now use a separate pointer to the block for extending it and
...@@ -2012,7 +2021,7 @@ _kernel_oserror *readedid(int displaynum, const char *file) ...@@ -2012,7 +2021,7 @@ _kernel_oserror *readedid(int displaynum, const char *file)
/* Check the block is valid */ /* Check the block is valid */
if (!res) if (!res)
{ {
res = Check_EDID_Checksum(edidblock, true); res = check_edid_checksum(edidblock, true);
} }
} }
} }
......
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