Commit d893357d authored by Steve Revill's avatar Steve Revill
Browse files

Added prototype EDID support code.

This should be considered beta-quality work-in-progress code that gives us a
new *command (ReadEDID) that attempts to read the list of supported display
mode information from a connected monitory and configure the system for it,
as if an MDF file had been loaded containing that information.

Admin:

Community testing is required for this feature. Please try replacing the
LoadModeFile line in your !Boot.Choices.Boot.PreDesk.Configure.Monitor
file with a line saying "ReadEDID". If you get a sensible looking list
of modes when the machine boots, then things should be OK. If you see an
error, please get in touch with ROOL on the "Bounties - ReadEDID" topic.
You'll clearly need to be running a ROM with this version of ScreenModes
in it!

Version 0.39. Tagged as 'ScrModes-0_39'
parent 39a0150d
No preview for this file type
...@@ -24,3 +24,5 @@ E20:Es wurde keine Bildschirm-Beschreibungsdatei geladen. ...@@ -24,3 +24,5 @@ E20:Es wurde keine Bildschirm-Beschreibungsdatei geladen.
E22:Es wurde ein unbekannter ScreenModes_ReadInfo-Aufruf gemacht. E22:Es wurde ein unbekannter ScreenModes_ReadInfo-Aufruf gemacht.
E23:Es wird eine Zahl erwartet. E23:Es wird eine Zahl erwartet.
E24:Es wurde ein zu großer Parameterwert angegeben. E24:Es wurde ein zu großer Parameterwert angegeben.
E25:EDID checksum is incorrect (block %0 of %1 failed) - cannot read monitor settings
E26:Unable to read EDID - does this hardware support it?
No preview for this file type
...@@ -24,3 +24,5 @@ E20:No monitor description file loaded ...@@ -24,3 +24,5 @@ E20:No monitor description file loaded
E22:Unknown ScreenModes_ReadInfo call E22:Unknown ScreenModes_ReadInfo call
E23:Number expected E23:Number expected
E24:Overlarge value for parameter E24:Overlarge value for parameter
E25:EDID checksum is incorrect (block %0 of %1 failed) - cannot read monitor settings
E26:Unable to read EDID - does this hardware support it?
/* (0.38) /* (0.39)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 0.38 #define Module_MajorVersion_CMHG 0.39
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Mar 2014 #define Module_Date_CMHG 08 Feb 2015
#define Module_MajorVersion "0.38" #define Module_MajorVersion "0.39"
#define Module_Version 38 #define Module_Version 39
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "09 Mar 2014" #define Module_Date "08 Feb 2015"
#define Module_ApplicationDate "09-Mar-14" #define Module_ApplicationDate "08-Feb-15"
#define Module_ComponentName "ScrModes" #define Module_ComponentName "ScrModes"
#define Module_ComponentPath "castle/RiscOS/Sources/Video/UserI/ScrModes" #define Module_ComponentPath "castle/RiscOS/Sources/Video/UserI/ScrModes"
#define Module_FullVersion "0.38" #define Module_FullVersion "0.39"
#define Module_HelpVersion "0.38 (09 Mar 2014)" #define Module_HelpVersion "0.39 (08 Feb 2015)"
#define Module_LibraryVersionInfo "0:38" #define Module_LibraryVersionInfo "0:39"
This diff is collapsed.
...@@ -25,6 +25,8 @@ date-string: Module_Date_CMHG ...@@ -25,6 +25,8 @@ date-string: Module_Date_CMHG
title-string: ScreenModes title-string: ScreenModes
initialisation-code: ScreenModes_initialise
finalisation-code: ScreenModes_final finalisation-code: ScreenModes_final
; service calls - the only ones we answer to are Service_EnumerateScreenModes, ; service calls - the only ones we answer to are Service_EnumerateScreenModes,
...@@ -32,14 +34,18 @@ finalisation-code: ScreenModes_final ...@@ -32,14 +34,18 @@ finalisation-code: ScreenModes_final
service-call-handler: ScreenModes_servicecall Service_EnumerateScreenModes, service-call-handler: ScreenModes_servicecall Service_EnumerateScreenModes,
Service_ModeExtension, Service_ModeExtension,
Service_ModeTranslation, Service_ModeTranslation,
Service_DisplayChanged Service_DisplayChanged,
Service_MonitorLeadTranslation
international-help-file: "Resources:$.Resources.ScreenMode.Messages" international-help-file: "Resources:$.Resources.ScreenMode.Messages"
command-keyword-table: ScreenModes_cmdhandler command-keyword-table: ScreenModes_cmdhandler
LoadModeFile(min-args:1, max-args: 1, international:, LoadModeFile(min-args:1, max-args: 1, international:,
invalid-syntax: "SSMDLMF", invalid-syntax: "SSMDLMF",
help-text: "HSMDLMF") help-text: "HSMDLMF"),
ReadEDID(min-args:0,max-args:0, international:,
invalid-syntax: "SSMDRED",
help-text: "HSMDRED")
swi-chunk-base-number: 0x487C0 swi-chunk-base-number: 0x487C0
......
/* Copyright 2015 Castle Technology Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* EDIDModes.h */
/* TODO: comments required throughout this file */
#define MAXMODENAMESIZE (25)
#define EDID_SIZE (128)
/* Defines which is the most advanced timing calculation available
* We use DMT if defined for that mode and calculate using the timing
* If not. If USE_DMT is highest it is DMT or nothing.
*/
#define EDID_USE_DMT (0)
#define EDID_USE_GTF (1)
#define EDID_USE_GTF2 (2)
#define EDID_USE_CVT (3)
#define EDID_USE_CVTRB (4)
typedef struct _STDMODE
{
char ModeName[MAXMODENAMESIZE];
uint32_t Refresh;
uint32_t SyncPulse;
uint32_t HTotal;
uint32_t XRes;
uint32_t HSync;
uint32_t HFrontPorch;
uint32_t HBackPorch;
double PixRate;
uint32_t VTotal;
uint32_t YRes;
uint32_t VSync;
uint32_t VFrontPorch;
uint32_t VBackPorch;
} STDMODE;
typedef struct _EDIDBlock
{
/* 8 bytes of header */
uint8_t header[8];
/* 10 bytes of vendor id */
uint8_t manufacturer_id[2];
uint8_t product_id[2];
uint8_t serial[4];
uint8_t week_made;
uint8_t year_made;
/* 2 bytes of EDID Structure and version */
uint8_t edid_version;
uint8_t edid_revision;
/* 5 bytes of Basic parameters */
uint8_t video_input_definition;
uint8_t horizontal_screen_size; /* Listed in cm. Aspect ratio - landscape */
uint8_t vertical_screen_size; /* Listed in cm. Aspect ratio - portrait */
uint8_t gamma;
uint8_t feature_support;
/* 10 bytes of colour characteristics */
uint8_t colour_characteristics[10];
/* 3 bytes of established timings */
uint8_t established_timings[3];
/* 16 bytes of standard timings identification 1-8 */
uint8_t standard_timings[16];
/* 72 bytes of 18 byte data blocks; */
uint8_t data_block[4][18];
/* Extension blocks */
uint8_t extension_block_count;
uint8_t checksum;
} EDIDBlock, *EDIDBlockRef;
typedef struct _EDIDExtensionBlock
{
uint8_t tag;
uint8_t revision;
uint8_t data[125];
uint8_t checksum;
} EDIDExtensionBlock, *EDIDExtensionBlockRef;
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
#define ERR_BADREADINFO 22 /* Unknown ScreenModes_ReadInfo call */ #define ERR_BADREADINFO 22 /* Unknown ScreenModes_ReadInfo call */
#define ERR_EXPNUM2 23 /* Number expected */ #define ERR_EXPNUM2 23 /* Number expected */
#define ERR_VALUEOVF2 24 /* Overlarge value for parameter */ #define ERR_VALUEOVF2 24 /* Overlarge value for parameter */
#define ERR_BADCHECKSUM 25 /* EDID Checksum failed */
#define ERR_CANTREADEDID 26 /* Cannot read EDID */
#define ERR_IICOPFAIL 27 /* IICStatus reported an error reading EDID*/
/* EOF errors.h */ /* EOF errors.h */
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* Internal definitions used by ScreenModes module. * Internal definitions used by ScreenModes module.
*/ */
/* /*
* The 6 field framing parameters for each direction, horizontal and * The 6 field framing parameters for each direction, horizontal and
* vertical. In horizontal case, the parameters are measured in VIDC * vertical. In horizontal case, the parameters are measured in VIDC
...@@ -142,7 +141,7 @@ typedef struct ...@@ -142,7 +141,7 @@ typedef struct
uint32_t external_clock; /* rate of external clock in kHz (use it instead of VCO), or -1 */ uint32_t external_clock; /* rate of external clock in kHz (use it instead of VCO), or -1 */
uint8_t syncpol; /* sync polarity code (0..3 for now) */ uint8_t syncpol; /* sync polarity code (0..3 for now) */
uint8_t interlaced; /* whether mode is interlaced using two seperate framebuffers (0 or 1) */ uint8_t interlaced; /* whether mode is interlaced using two seperate framebuffers (0 or 1) */
uint8_t spare1, spare2; /* explicit padding so struct is N*4 bytes long */ uint8_t freq, spare2; /* explicit padding so struct is N*4 bytes long */
} ModeDefinition; } ModeDefinition;
/* As stored internally by ScreenModes module */ /* As stored internally by ScreenModes module */
...@@ -168,5 +167,19 @@ typedef struct ...@@ -168,5 +167,19 @@ typedef struct
uint32_t output_format; /* 0=analogue, 1=digital */ uint32_t output_format; /* 0=analogue, 1=digital */
} MonitorDescription, *MonitorDescriptionRef; } MonitorDescription, *MonitorDescriptionRef;
/* Maps a 2-byte 'STD code' to a DMT (STD codes defined in EDID spec)*/
typedef struct
{
char stdcode[2]; /* TODO: comment required here */
char dmt; /* TODO: comment required here */
} STDTiming;
/* Maps a 3-byte 'CVT code' to a DMT (CVT codes defined in EDID spec)*/
typedef struct
{
char cvtcode[3]; /* TODO: comment required here */
char dmt; /* TODO: comment required here */
} CVTTiming;
/* EOF modex.h */ /* EOF modex.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