1. 02 Mar, 2020 1 commit
    • Jeffrey Lee's avatar
      Improve established mode timing support · 99bc86e7
      Jeffrey Lee authored
      Add definitions for 640x480 @ 67Hz, 832x624 @ 75Hz, and 1152x870 @ 75Hz,
      gleaned from various monitor manuals. These work on the monitors I have
      at my disposal (e.g. BenQ FP737s-D) without generating any warnings.
      
      Version 0.74. Tagged as 'ScrModes-0_74'
      99bc86e7
  2. 29 Jun, 2019 1 commit
  3. 29 Nov, 2018 1 commit
    • Jeffrey Lee's avatar
      Improve ExtraBytes handling, double-pixel mode handling, and Service_ModeTranslation · b613fdbb
      Jeffrey Lee authored
      Detail:
        c/ScrModes:
        - Automatically use ExtraBytes to request that the row length is a multiple of a word (since things fail with non-word aligned rows)
        - Fix maxdatasize check in mode_valid to take into account ExtraBytes
        - Fix discrepancy between kernel OfferDoublePixelModeExtension & ScreenModes offer_doublepixel_modeextension: For >16bpp double-pixel we should downgrade to non- double-pixel instead of giving up completely
        - Make Service_ModeTranslation attempt to map the result back to a (kernel) mode number, as per the kernel's Service_ModeTranslation
      Admin:
        Tested on BB-xM
      
      
      Version 0.72. Tagged as 'ScrModes-0_72'
      b613fdbb
  4. 07 Nov, 2018 1 commit
    • Jeffrey Lee's avatar
      Improve mode substitution logic · 6b9b62ab
      Jeffrey Lee authored
      Detail:
        This updates ScreenModes to use similar mode substition logic to Kernel-6_14:
        - Try higher colour depths
        - Try lower colour depths
        - Try alternate resolutions (half-width non-double-pixel if original was double-pixel, assorted industry-standard resolutions, and monitor preferred resolution/timings)
        - Plus tries to preserve as many attributes as possible (eigen values, gap mode type, etc.)
        Additionally, LineLength values in the input mode selector block will be used to influence the VIDC list ExtraBytes value, as per the kernel
        File changes:
        - c/ScrModes - Update Service_ModeTranslation and Service_ModeExtension handlers, as described above
        - h/modex - "const PixelFormatRef" is a const pointer to a non-const PixelFormat, but we want "const PixelFormat *", for a pointer to a const PixelFormat
      Admin:
        Tested on Raspberry Pi 3, Iyonix, IGEPv5
        Note that we can't easily remove the Service_ModeTranslation handler from ScreenModes and rely purely on the one in the kernel because the kernel can't easily see which modes ScreenModes provides (ditto other Service_ModeTranslation handlers).
      
      
      Version 0.71. Tagged as 'ScrModes-0_71'
      6b9b62ab
  5. 25 Sep, 2018 1 commit
    • Robert Sprowson's avatar
      Fix memory leak and undefined behaviour · 45b37ed5
      Robert Sprowson authored
      edidsupport.c: for each CVT3 and standard timing block encountered a ModeDescription was allocated but never used, thus leaked.
      ScrModes.c: start the bit masking loop at 0, otherwise a mask of 1<<-1 is used.
      Found by cppcheck static analysis.
      
      Aside - edidsupport.c the calls to dtd_block_to_modedesc() could be refactored to let it do the allocation, rather than each caller doing so and having to deal with clean up on error. Not done in these changes.
      
      Version 0.70. Tagged as 'ScrModes-0_70'
      45b37ed5
  6. 16 Sep, 2018 1 commit
  7. 31 Mar, 2018 1 commit
    • Robert Sprowson's avatar
      Service call API clean up · 60419cc7
      Robert Sprowson authored
      There's no need to graft in a special sub-sub-reason for Service_DisplayChanged, since ScrModes always reads the EDID at power up the data blob is already there. To force it to be used (in situations where the user had selected a disc based textual MDF) simply load it with *LoadModeFile.
      
      Version 0.68. Tagged as 'ScrModes-0_68'
      60419cc7
  8. 11 Jul, 2017 1 commit
    • Jeffrey Lee's avatar
      Make EDID handling more robust · c3128e9b
      Jeffrey Lee authored
      Detail:
        c/edidsupport:
        - Make readedid() check that the EDID has a valid header. Previously only the checksum was checked, which is wholly insufficient (e.g. an EDID block full of null bytes would be considered valid). loadedid() also updated for consistency, although with the current code the header will have already been detected by loadmodefile().
        - Add some extra checks to readedidblock() to cope with more situations in which the GraphicsV call could fail. Fix confusing comment/code ordering.
        h/errors, Resources/Germany/Messages, Resources/UK/Messages - Add new "Invalid EDID block" error, for use when no valid header is found
      Admin:
        Tested on Raspberry Pi 3
        Booting an EDID-enabled Pi without a monitor (and with the broken BCMVideo 0.47) no longer results in an (unintelligible) error box on entry to the desktop + system stuck in mode 0
        However, note that other issues in the boot sequence mean that booting with EDID enabled and no monitor still isn't 100% working (PreDesk Repeat will terminate early, potentially skipping some directories)
      
      
      Version 0.67. Tagged as 'ScrModes-0_67'
      c3128e9b
  9. 17 Jun, 2017 1 commit
    • Jeffrey Lee's avatar
      Fix EDID use at startup · f695ced1
      Jeffrey Lee authored
      Detail:
        c/ScrModes - Re-introduce the using_edid check in the Service_DsiplayChanged handler, that was removed in ScreenModes 0.64.
        Removing the check completely breaks automatic EDID use (via MonitorType EDID), causing the kernel to panic and treat everything as mode 0 (due to no mode definitions being available).
      Admin:
        Tested on Raspberry Pi 3
        Should fix issue reported on forums (bad screen mode during boot after upgrading from RC15):
        https://www.riscosopen.org/forum/forums/4/topics/9342
      
      
      Version 0.66. Tagged as 'ScrModes-0_66'
      f695ced1
  10. 07 Jun, 2017 1 commit
    • Jeffrey Lee's avatar
      Add support for new GraphicsV_VetMode2 call · 94ffeea7
      Jeffrey Lee authored
      Detail:
        VetMode2 allows the driver to give the OS extra feedback about a proposed mode. In particular, it allows the driver to suggest a value for the ExtraBytes control list item, so by using the VetMode2 call ScreenModes is able to support modes where the video driver requires extra padding to be added to the framebuffer.
        h/modex - Remove local definitions of control list item numbers. Reserve space for one extra control list item in the VIDCList structure.
        c/ScrModes - Use Global/VIDCList.h for control list item numbers. Update mode_valid to make use of VetMode2 where available, and give it the ability to copy the resulting VIDCList into a caller-supplied buffer, allowing service_modeextension to easily use the correct ExtraBytes setting.
      Admin:
        Tested on Raspberry Pi 3
        Requires Kernel-5_82
      
      
      Version 0.65. Tagged as 'ScrModes-0_65'
      94ffeea7
  11. 01 May, 2017 1 commit
    • John Ballance's avatar
      Remove ReadEDID command. Extend Service_DisplayChanged response · f825c04b
      John Ballance authored
      Detail:
      ReadEDID command removed. New subreason code added to reason code 0
      of Service_DisplayChanged to oblige ScrModes to load the EDID based
      modes it discovered. Required because current behaviour would ignore
      any EDID based modes once a LoadModeFile command had been issued.
      Admin:
      Tested on iMx6
      
      Version 0.64. Tagged as 'ScrModes-0_64'
      f825c04b
  12. 12 Mar, 2017 2 commits
  13. 05 Mar, 2017 2 commits
    • ROOL's avatar
      Offer export of raw EDID blob and complementary MDF export · 961adc98
      ROOL authored
      Detail:
        Export the EDID raw data as a file in ResourceFS. This allows the Screen Setup plugin to scan that directory to pick up the currently connected monitor, and similarly select it from !Boot.Choices.PreDesk. The EDID data can also be drag & drop copied or exported for offline analysis.
        Add SaveModeFile command. This differs in that it works on the current set, to be symmetrical with LoadModeFile which loads the current set. Also fixes issues of losing the original mode names given; NULL pointer dereference when the EDID block contains no modes (eg. VIDCDriver); and no long writes out malformed MDFs which can't be loaded into !MakeModes (this seems to be because the CreateModeFile command was based on a stale copy of EDIDDecode which fixed the same bug circa 2012).
        Query the current GraphicsV driver for the deepest colour depth for the preferred mode, rather than assuming 32bpp is always possible (eg. because of bandwidth or graphics controller constraints).
        If the configured MonitorType is EDID but no EDID could be read, or it was corrupt, substitute a safe VESA monitor to allow the kernel to select something close to MODE 28.
        Add ScreenModes_Features SWI so the Screen Setup plugin knows whether it's safe to offer EDID in its dialogues.
        Retire the ReadEDID command (no longer needed since LoadModeFile can load the exported EDID blob, or one from disc) and CreateModeFile commands (see SaveModeFile).
        Internationalise the default monitor title ("Unidentified") used when EDID doesn't contain one.
      Admin:
        New file - doc/BootStates documents all possible situations, and their recovery, for both the MDF and (non-hotplug) EDID schemes.
        New file - doc/EDIDGoals states the aims of the EDID support from both a user and support perspective.
      
        Submission for the EDID bounty.
      
      Version 0.61. Tagged as 'ScrModes-0_61'
      961adc98
    • ROOL's avatar
      Check for array bounds · 95d1dca9
      ROOL authored
      Detail:
        Define MAXDMTMODENUM to guard against requesting DMT timing not in our table. Assert that the table size matches the define.
        Lowercased some 'X' (edidsupport.c), change to _swix (mdfsupport.c).
      Admin:
        Submission for the EDID bounty.
      
      Version 0.60. Tagged as 'ScrModes-0_60'
      95d1dca9
  14. 10 Dec, 2016 1 commit
  15. 26 Nov, 2016 1 commit
    • Jeffrey Lee's avatar
      Resolve allocation clash with RISCOS Ltd · 41b0cd05
      Jeffrey Lee authored
      Detail:
        Some cross-checking against the RISC OS Select documentation revealed that ScreenModes_ReadInfo 1 had already been claimed by ROL for the purpose of reading the monitor's supported DMPS state, causing a clash with our recently-introduced usage of reading the monitor speaker mask.
        Implement ScreenModes_ReadInfo 1 as per ROL's spec, and change the "read speaker mask" call to ScreenModes_ReadInfo 2.
        File changes:
        - c/ScrModes, hdr/ScrModes - as above
      Admin:
        Tested on Raspberry Pi
      
      
      Version 0.58. Tagged as 'ScrModes-0_58'
      41b0cd05
  16. 06 Aug, 2016 2 commits
    • ROOL's avatar
      Do fill in DPMS support · e1d639d1
      ROOL authored
      Detail:
        Don't ignore the monitor's power saving features for EDID; fill in the DPMS value properly.
      Admin:
        Submission for the EDID bounty.
      
      Version 0.57. Tagged as 'ScrModes-0_57'
      e1d639d1
    • ROOL's avatar
      Omit mode name from lookup tables · d0b58c2a
      ROOL authored
      Detail:
        Save 4k of ROM space by not storing the mode name string; always generate it at run time.
        Split the ModeDefinition struct into the timings part (ModeDef) and full definition (ModeDefinition).
      Admin:
        Submission for the EDID bounty.
        Tagged as ScrModes-0_56-smalltables.
      d0b58c2a
  17. 30 Jul, 2016 4 commits
    • ROOL's avatar
      Take advantage of tail of generate functions being common · faff5d05
      ROOL authored
      Detail:
        Now all generation steps end in compute_modedescription()/add_proposed_mode()/display_mode_parameters(), combine these steps into the add_proposed_mode() function.
        Fix for CVT and GTF generation steps never setting the 'priority' member of the descriptor. These are now set to 6 per Table 5.1 of EDID spec 1.4.
      Admin:
        Submission for the EDID bounty.
      
      Version 0.56. Tagged as 'ScrModes-0_56'
      faff5d05
    • ROOL's avatar
      Make alloc ownership and mode submission consistent · 11cf5235
      ROOL authored
      Detail:
        In various places the free() on error was the responsibility of the called function, and sometimes the calling function. Rationalise this by returning true/false so the free() is always done at the same level as malloc().
        Likewise, add_proposed_mode() is now done at the level that generates the mode.
        Tidy up debug so that only successfully generated and added modes get debug printed with display_mode_parameters(), not discarded ones.
      Admin:
        Submission for the EDID bounty.
        Tagged as ScrModes-0_55-mallocfree.
      11cf5235
    • ROOL's avatar
      Fixes to CVT3 calcs · 041d7311
      ROOL authored
      Detail:
        Missing break statements (around line 790) would always have selected 50Hz frame rate regardless.
        Removed duplicate call to add_proposed_mode() which generate_mode_using_cvt_rb() already does, resulting in duplicated modes.
      Admin:
        CVT3 still untested, but less broken than before.
        Submission for the EDID bounty.
        Tagged as ScrModes-0_55-cvt3fix.
      041d7311
    • ROOL's avatar
      Switch to integer implementation · 862ea508
      ROOL authored
      Detail:
        The dynamic range of the values being computed easily fit within integer types, so use these instead of doubles. This makes ScrModes independent of its position in intialisation with respect to FPEmulator once more, and saves 1k of code space too.
        Functions generate_mode_using_gtf(), generate_mode_using_cvt_rb(), generate_cvt3_timing() affected.
      Admin:
        Test added to brute force compare float and fixed point results.
        Submission for the EDID bounty.
      
      Version 0.55. Tagged as 'ScrModes-0_55'
      862ea508
  18. 21 May, 2016 1 commit
    • ROOL's avatar
      Non code changes · b2421153
      ROOL authored
      Admin:
        Line up braces missed in earlier tidying.
        Not tagged.
      b2421153
  19. 14 May, 2016 3 commits
    • ROOL's avatar
      Fix bug in CVT-RB timing calculation, add GTF range check · ea866f88
      ROOL authored
      Detail:
        Rounding the pixel clock to 0.25MHz was not correctly performed due to clock step division being outside the floor() function, so all times came out in steps of 1MHz.
        In GTF timing with interlacing v_lines_rqd specifies ROUND(v_lines/2,0) rather than ROUNDDOWN(v_lines/2,0).
        Abandon GTF calculations early if they result in a -ve duty cycle.
        Update margins to 1.8% from standard.
      Admin:
        Mode with non-multiple-of-1MHz clock tested, now matches VESA CVT spreadsheet.
        GTF change not tested since int_rqd = 0 the code wasn't called.
        Margin% change not tested since margins_rqd = 0 the code wasn't called.
        Submission for the EDID bounty.
      
      Version 0.54. Tagged as 'ScrModes-0_54'
      ea866f88
    • ROOL's avatar
      Split out MDF and EDID support · 9936b759
      ROOL authored
      Detail:
        Main source file split into 3.
      Admin:
        Tested briefly, functionality unchanged.
        Submission for the EDID bounty.
        Tagged as ScrModes-0_53-split
      9936b759
    • ROOL's avatar
      Split out data tables, stylistic refactoring · 8a00983b
      ROOL authored
      Detail:
        Move the 500+ lines of tables into a new source file and remove storage inferred by former CEAModes.h.
        Tame some of the rampant style from various authors, even within 1 function, to something reasonably consistent.
        Uppercase the 'debug' macro to 'IFDEBUG'.
        Relocate ScrModes specific defines out of EDIDModes header, rename to edidmemory.h.
        Add monitor type 6 to monitors.h.
        Fix for unguarded debug printout "Can't allocate space for monitor list" in parseedid.
      Admin:
        Tested briefly, functionality unchanged.
        Submission for the EDID bounty.
        Tagged as ScrModes-0_53-tables
      8a00983b
  20. 10 Jan, 2016 1 commit
    • Jeffrey Lee's avatar
      Add support for parsing CEA Short Video Descriptors (SVDs). Fix loaded EDID... · 55179bbd
      Jeffrey Lee authored
      Add support for parsing CEA Short Video Descriptors (SVDs). Fix loaded EDID files being overwritten with monitor EDID during Service_DisplayChanged.
      
      Detail:
        h/CEAModes - Table of CEA mode timings from CEA 861-D
        s/ScrModes - Implement process_cea_video_data_block() in order to support SVD parsing. Ensure loadedid() sets the EDIDEnabled flag to 0, to prevent the loaded EDID (potentially) being replaced during Service_DisplayChanged.
      Admin:
        Tested on iMx6
      
      
      Version 0.53. Tagged as 'ScrModes-0_53'
      55179bbd
  21. 08 Jan, 2016 1 commit
    • Jeffrey Lee's avatar
      Fix *LoadModeFile not reporting errors when parsing EDID files. Fix another... · fc351291
      Jeffrey Lee authored
      Fix *LoadModeFile not reporting errors when parsing EDID files. Fix another "RMA allocation failed" bug with audio format processing.
      
      Detail:
        c/ScrModes - Fix loadedid() not returning errors from parseedid()
        c/ScrModes - Fix bad use of realloc() in add_audio_format() - if audio_format_count hits zero then it's expected for realloc to return NULL.
      Admin:
        Tested on iMx6
      
      
      Version 0.52. Tagged as 'ScrModes-0_52'
      fc351291
  22. 06 Jan, 2016 1 commit
    • Jeffrey Lee's avatar
      Fix audio format merge logic · 7d5fe81e
      Jeffrey Lee authored
      Detail:
        c/ScrModes - When removing 'candidate' from the list of audio formats, it's the number of formats which we want to decrement, not the pointer to the start of the list.
      Admin:
        Tested on iMx6
        Fixes "RMA allocation failed" and other issues when dealing with monitors with complex audio capabilities
      
      
      Version 0.51. Tagged as 'ScrModes-0_51'
      7d5fe81e
  23. 15 Dec, 2015 1 commit
    • Jeffrey Lee's avatar
      Fix a few issues with EDID established timings · eeb8be91
      Jeffrey Lee authored
      Detail:
        c/ScrModes:
        - Added established timings for 720x400 @ 70Hz to be used in place of the auto-generated timings. For a BenQ FP737s-D, these match the expected timings listed in the manual, and they actually result in a picture displaying (auto-generated timings did not).
        - Split the guts of generate_dmt_mode out into a separate function so it can easily be used for adding the 720x400 @ 70Hz ModeDefinition
        - Fix established timing handling to only call generate_dmt_mode if the DMT defines timings for a given mode (old logic meant that only 720x400 @ 70Hz was falling through to the auto-generate case)
        - Fix established timing auto-generation to cope with the possibility of timings_byte being non-zero
      Admin:
        Tested on iMx6 on a variety of monitors
        720x400 @ 70Hz now displays correctly on a FP737s-D
        640x480 @ 67Hz now works too (albeit with a warning about being a non-preset mode, this one is listed in the EDID but not in the manual)
      
      
      Version 0.50. Tagged as 'ScrModes-0_50'
      eeb8be91
  24. 29 Nov, 2015 1 commit
    • Jeffrey Lee's avatar
      Add support for parsing and reporting the contents of CEA 861-D audio-related EDID blocks · 9a30976a
      Jeffrey Lee authored
      Detail:
        Makefile - Export a C version of hdr/ScrModes
        Resources/Germany/Messages, Resources/UK/Messages, h/errors - Add new error message
        cmhg/ScrModesv, hdr/ScrModes - Declare existence of ScreenModes_EnumerateAudioFormats SWI. Declare ScreenModes_ReadInfo reason codes.
        h/modex - Extend MonitorDefinition struct to allow it to store the speaker mask & audio format information that's extracted from the EDID
        c/ScrModes - Extend support for processing of CEA extension blocks. All block revisions > 0 should now be accepted, and rudimentary parsing of CEA data block collections is implemented (currently, only extracts information from audio related blocks). Add SWI ScreenModes_EnumerateAudioFormats to allow details of the supported formats to be returned in either "raw" or "friendly" forms. Add ScreenModes_ReadInfo reason code 1 to allow reading of the speaker mask (+ validity bits). Also fix *LoadModeFile to al...
      9a30976a
  25. 24 Feb, 2015 2 commits
    • Jeffrey Lee's avatar
      Fix some more sync polarity issues. Don't support DTDs for stereoscopic modes. · 2accbe62
      Jeffrey Lee authored
      Detail:
        c/ScrModes - Replace magic numbers used for sync polarities with HSync_Positive, VSync_Negative, etc. #defines. Fix GTF2 polarity to be correct. Fix CVT/CVT RB polarities to be correct (+ some incorrect code indentation). Make dtd_block_to_modedesc return true/false for success/failure so we can reject stereoscopic 3D modes.
      Admin:
        Tested on Pandaboard
      
      
      Version 0.48. Tagged as 'ScrModes-0_48'
      2accbe62
    • Jeffrey Lee's avatar
      Fix decoding of DTD sync polarities. Add support for some missing established timings. · 8f3400df
      Jeffrey Lee authored
      Detail:
        c/ScrModes - Fixed decoding of DTD polarties in dtd_block_to_modedesc. Add support for some missing established timings (generated by GTF/CVT as we don't have any known-good values to use as a reference)
      Admin:
        Tested on Pandaboard
        Submission from William Harden
      
      
      Version 0.47. Not tagged
      8f3400df
  26. 20 Feb, 2015 3 commits
    • Jeffrey Lee's avatar
      Avoid potential read of bad address in CEA block processing · 020db416
      Jeffrey Lee authored
      Detail:
        c/ScrModes - Reorder while loop conditions to ensure the DTD offset is checked before we try reading any data; prevents potential data abort if initial offset is too large to be valid.
      Admin:
        Builds, untested
      
      
      Version 0.47. Retagged as 'ScrModes-0_47'
      020db416
    • Jeffrey Lee's avatar
      Fix DERIVE_CVT3_FROM_DMT · d4ee2737
      Jeffrey Lee authored
      Detail:
        c/ScrModes - Swap 'return;' for 'return NULL;' in the (currently unused) DERIVE_CVT3_FROM_DMT code to ensure the function has a sensible return value
      Admin:
        Untested
      
      
      Version 0.47. Retagged as 'ScrModes-0_47'
      d4ee2737
    • Jeffrey Lee's avatar
      Add support for CVT 3 byte codes & VTB-EXT blocks. Other misc fixes. · ca1955a4
      Jeffrey Lee authored
      Detail:
        c/ScrModes, h/modex - Added support for CVT 3 byte codes & VTB-EXT blocks. Add framework for sorting modes by EDID priority. Move CEA extension block handling into its own function & increase error checking.
        Resources/Germany/CmdHelp, Resources/UK/CmdHelp - Fix missing message token & incorrect syntax of syntax message
      Admin:
        Code submission from William Harden
        Tested on Raspberry Pi
      
      
      Version 0.47. Tagged as 'ScrModes-0_47'
      ca1955a4
  27. 16 Feb, 2015 2 commits
    • Jeffrey Lee's avatar
      Fix bad merge. Improve Get_DTD_ASCII & MDF saving. · 92a69868
      Jeffrey Lee authored
      Detail:
        c/ScrModes - Fix a bad merge causing a compute_modedescription() call to go missing. Fix Get_DTD_ASCII to avoid reading one byte too many, and to ensure the buffer is null terminated. Also strip any control characters. Improve MDF saving to return an error if the file couldn't be created, and to substitute various unsafe characters with underscores
      Admin:
        Tested on Pandaboard
      
      
      Version 0.46. Tagged as 'ScrModes-0_46'
      92a69868
    • John Ballance's avatar
      Added 'CreateModeFile' instead of optional file name on ReadEDID now needs a... · 16d50f7d
      John Ballance authored
      Added 'CreateModeFile' instead of optional file name on ReadEDID now needs a file path for where to save the created mdf. It'll use the name in the EDID for the file name
      
      Admin:
       tested in iMx6
      
      Version 0.45. Tagged as 'ScrModes-0_45'
      16d50f7d
  28. 14 Feb, 2015 1 commit
    • Jeffrey Lee's avatar
      Fix bogus vertical bounds reported in MDF comments · 97cb9b7c
      Jeffrey Lee authored
      Detail:
        c/ScrModes - Make sure compute_modedescription is used to initialise frame_mhz (and line_hz). Fixes bogus vertical bounds in MDF comments, and will fix order of modes as defined by sorting function modes_inorder.
        Also change horizontal bounds comment to use stored line_hz value instead of computing it on the fly
      Admin:
        Tested on Pandaboard
      
      
      Version 0.44. Tagged as 'ScrModes-0_44'
      97cb9b7c