Methods, devices, equipment and media for switching screen resolution configuration
By writing and matching the resolution identifier in the boot loader and switching the boot configuration file, the problem of embedded motherboards being unable to automatically recognize LVDS screen resolutions is solved. This enables the same firmware to be compatible with multiple screens, reduces operating costs, and improves the stability and scalability of the device.
Patent Information
- Application Number
- CN202611388916.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-08
- Publication Date
- 2026-11-17
AI Technical Summary
In the existing technology, embedded motherboards cannot automatically recognize LVDS screen resolutions, which requires compiling different firmware versions for screens with different resolutions. This increases the number of firmware versions and the complexity of production and inventory preparation. Furthermore, the timing parameter mismatch problem cannot be corrected after the operating system starts up.
By writing and matching the resolution identifier in the startup loader and switching the startup configuration file, the correct screen configuration is ensured to be selected before display initialization, and the timing and control parameters are initialized by the display driver after the operating system starts, thus achieving automatic screen resolution compatibility.
It reduces the complexity of firmware version management and production costs, avoids display anomalies during the startup phase, improves the fault tolerance and scalability of the device, and simplifies the screen model replacement process.
Smart Images

Figure CN123114615A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of screen control technology, and in particular to a method, apparatus, device and storage medium for switching screen resolution configuration. Background Technology
[0002] Embedded motherboards often need to be compatible with LVDS screens of different specifications. For example, the same hardware platform may be equipped with screens of different resolutions, such as 1024x600 or 1024x768. As a differential signal transmission display interface, the timing parameters of an LVDS screen are entirely determined by the screen's physical specifications. Different resolutions correspond to different pixel clock frequencies, horizontal sync widths, vertical sync widths, and timing parameters such as leading and trailing edges. Unlike HDMI or DP interfaces, LVDS interfaces typically do not include a DDC channel for transmitting display capability information. Most LVDS screens also do not provide screen identifiers or EDID data that can be read through the display interface, causing electronic devices to be unable to automatically detect the resolution of the currently connected screen during startup. If the bootloader or operating system initializes the display controller using only a fixed set of LVDS timing parameters, and these parameters do not match the actual timing requirements of the screen, abnormal phenomena such as black screens, distorted screens, stretched images, or bright backlights without displayed content will occur during startup.
[0003] To address these issues, common existing technologies involve compiling different firmware versions for screens of different resolutions, or maintaining different device tree files and display configuration files. During production, the corresponding firmware must be flashed into the device based on the screen model. Similarly, when replacing a screen in after-sales service, the matching firmware must also be replaced. This approach results in a linear increase in the number of firmware versions with the number of compatible screen models, increasing the complexity of version management and production inventory. Furthermore, some developers place multiple screen configurations in the startup configuration file. However, if the display controller still points to a fixed configuration, the operating system may still load the wrong display path after startup, failing to fundamentally solve the configuration-screen mismatch problem.
[0004] Therefore, how to make a single firmware version compatible with multiple LVDS screens when it cannot automatically identify screen specifications has become an urgent technical problem to be solved. It should be noted that the information disclosed in the background section above is only for enhancing the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] In view of the above, this application provides a method, apparatus, device and storage medium for switching screen resolution configuration, the purpose of which is to solve the above-mentioned technical problems.
[0006] In a first aspect, this application provides a method for switching screen resolution configurations, the method comprising: In response to an externally input target resolution, a resolution identifier corresponding to the target resolution is written to a pre-set identifier storage area; During the startup phase of the electronic device and before display initialization, the resolution identifier is obtained by reading the identifier storage area through the startup loading program; The resolution identifier is matched with multiple preset identifiers by starting the loading program, and the target configuration is determined based on the matching results; The startup loader switches the current display configuration in the startup configuration file to the target configuration and reconstructs the startup configuration file according to the target configuration. The operating system starts, and the display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen.
[0007] Secondly, this application provides a screen resolution configuration switching device, which includes: Write module: In response to an externally input target resolution, write a resolution identifier corresponding to the target resolution to a pre-set identifier storage area; Reading module: used to obtain the resolution identifier by reading the identifier storage area through the startup loading program during the startup phase of the electronic device and before display initialization; Matching module: used to match the resolution identifier with multiple preset identifiers by starting the loading program, and determine the target configuration based on the matching results; Switching module: used to switch the current display configuration in the startup configuration file to the target configuration through the startup loader, and reconstruct the startup configuration file according to the target configuration; Output module: Used to start the operating system. The display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen.
[0008] Thirdly, this application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the steps of the screen resolution configuration switching method described in any embodiment of the first aspect.
[0009] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the screen resolution configuration switching method as described in any embodiment of the first aspect.
[0010] The technical solutions provided in this application have the following advantages compared with the prior art: By writing a resolution identifier to the identifier storage area in response to external input, screen specification settings can be completed during operating system runtime, eliminating the need to re-flash firmware or modify configuration files, thus reducing operational costs for production line configuration and after-sales maintenance. By reading this identifier and matching it to determine the target configuration during the startup phase, before display initialization, resolution selection is ensured to be completed before the initialization of underlying timing parameters, avoiding black screens or screen artifacts during startup due to timing errors. By switching the current display configuration to the target configuration and reconstructing the startup configuration file, the operating system obtains a unique and correct display link, eliminating loading ambiguity caused by multiple configurations coexisting. The removal of other configurations and redirection of output links during reconstruction ensures that the LVDS signal output by the display controller is accurately routed to the transmission channel corresponding to the target screen. After the operating system starts, the display driver initializes the timing and control parameters according to the reconstructed configuration file, ensuring that the hardware-level timing, power supply, and backlight are ready in the correct order, ultimately resulting in a stable output of the target resolution image. The default configuration ensures that the device can still display normally when the identifier is not written or fails to be read, which improves the fault tolerance of mass production and field maintenance. When adding a new screen model, only a set of preset identifiers and corresponding configurations need to be added to the configuration file. The overall process does not need to be changed, which has good scalability. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0012] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a preferred embodiment of the screen resolution switching method of this application; Figure 2 A schematic diagram of a preferred embodiment of the switching device configured for screen resolution in this application; Figure 3 This is a schematic diagram of a preferred embodiment of the electronic device of this application; The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0015] It should be noted that the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of those features. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed in this application.
[0016] Reference Figure 1 The diagram shown is a flowchart illustrating an embodiment of the screen resolution configuration switching method of this application. This method is executed by an electronic device, which can be implemented by a software system and / or a hardware system. The screen resolution configuration switching method includes: Step S10: In response to the target resolution input from the outside, write the resolution identifier corresponding to the target resolution to the pre-set identifier storage area; Step S10: During the startup phase of the electronic device and before display initialization, the resolution identifier is obtained by reading the identifier storage area through the startup loading program; Step S10: The resolution identifier is matched with multiple preset identifiers by starting the loading program, and the target configuration is determined based on the matching results; Step S10: Switch the current display configuration in the startup configuration file to the target configuration by starting the loader, and reconstruct the startup configuration file according to the target configuration; Step S10: Start the operating system. The display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen.
[0017] In embedded devices, LVDS screens typically lack EDID or screen identifier readback capabilities due to cost and interface limitations, preventing the system from automatically recognizing the currently connected screen resolution during startup. Traditionally, separate firmware is compiled for different screens or multiple device tree files are maintained. This not only increases the number of firmware versions but also necessitates simultaneous firmware updates during production line programming and after-sales screen replacement. If the firmware is incompatible with the screen, a black screen or distorted display will occur during startup. Furthermore, adjusting the user-mode resolution after the operating system has booted cannot correct the underlying timing parameters output by the bootloader; therefore, resolution switching must be completed before display initialization. To address these issues, this implementation provides a screen resolution configuration switching method. By using a non-volatile identifier to control the bootloader to select the corresponding display configuration before display initialization, a single firmware set becomes compatible with multiple screens while avoiding reliance on the screen's own identifier capabilities.
[0018] Specifically, an identification storage area is pre-defined in the non-volatile storage medium of the electronic device. At the same time, multiple alternative display configurations and a default display configuration are pre-defined in the startup configuration file of the startup loading program of the electronic device. Each alternative display configuration is associated with a preset identifier. Each alternative display configuration includes the screen number, LVDS timing parameters, backlight control parameters, power control parameters, and the connection relationship between the output of the display controller and the LVDS signal transmission channel defined by the configuration.
[0019] When an electronic device runs an operating system, a resolution configuration tool is deployed within the operating system. This tool receives the desired resolution as the target resolution from external input. This external input can come from production line automation scripts or commands issued by after-sales maintenance personnel via command line or graphical interface. Based on the target resolution, the configuration tool searches for a matching resolution identifier in a pre-set mapping between various resolutions and identifier values, and writes this identifier to the identifier storage area. After writing, the configuration tool reads back the written content from the identifier storage area to confirm a successful write operation, and then outputs a restart prompt. Through this write operation, users can set the screen identifier while the operating system is running, without needing to re-flash firmware or modify the device tree.
[0020] After receiving a restart command, the electronic device restarts. During the startup phase after restarting, the startup loader actively reads the identifier storage area before the display controller is initialized to obtain the resolution identifier stored therein. The startup loader then performs a matching operation between the read resolution identifier and the preset identifiers associated with each of the multiple candidate display configurations in the startup configuration file. Based on the result of the matching operation, it selects one of the multiple candidate display configurations as the target configuration. The target configuration includes at least one of the following: screen number, LVDS timing parameters, backlight control parameters, and power control parameters. For example, if the matching operation results in the existence of a preset identifier that matches the resolution identifier, then the candidate display configuration to which that preset identifier belongs is selected as the target configuration; if the matching operation results in the existence of no preset identifier that matches the resolution identifier, or the identifier storage area is empty or the read fails, then the startup loader selects the default display configuration as the target configuration. By completing the matching and selection before the display controller is initialized, it ensures that the timing parameters of subsequent initialization are consistent with the screen physical specifications.
[0021] After selecting a target configuration, the bootloader switches the current display configuration in the boot configuration file to that target configuration and performs a reconstruction operation on the boot configuration file based on the target configuration. The reconstruction operation includes ensuring the boot configuration file retains only the target configuration and removes all other alternative display configurations. Simultaneously, it points the output links of the display controller to the connection relationship defined by the target configuration, i.e., establishing a reference between the display controller output and the LVDS signal transmission channel corresponding to the target configuration. After reconstruction is complete, the bootloader transfers control to the operating system.
[0022] After the operating system boots, the display driver reads the reconstructed boot configuration file. From this file, it extracts the LVDS timing parameters, backlight control parameters, and power control parameters included in the target configuration. Based on these parameters, it initializes the LVDS output clock and synchronization signal, configures the backlight power supply, and configures the screen power timing. Following the connection relationships defined in the target configuration, it routes the display controller's output signals to the corresponding LVDS signal transmission channels, ultimately driving the screen to output the target resolution image. If a switch to a different screen resolution is required, simply run the configuration tool again within the operating system to write the new resolution identifier and restart the device. The bootloader will automatically complete the new resolution configuration switch during the next boot, without needing to re-flash the firmware.
[0023] Taking an embedded motherboard compatible with both 1024x600 and 1024x768 resolution LVDS screens as an example, an identifier storage area is pre-defined in the EEPROM. Identifier value 0x00 corresponds to 1024x600, and identifier value 0x01 corresponds to 1024x768. In the startup configuration file, configuration A is pre-set with the default identifier 0x00 and includes 1024x600 timing parameters, while configuration B is pre-set with the default identifier 0x01 and includes 1024x768 timing parameters. Configuration A is set as the default configuration. When the production line needs to assemble a 1024x768 screen, the operator runs the configuration tool under the operating system and selects 1024x768. The configuration tool writes 0x01 to the EEPROM and reads back for confirmation, prompting a restart. After the device restarts, the startup loading program reads the EEPROM before display initialization to obtain 0x01. It then iterates through the configuration files and finds that the default identifier 0x01 of configuration B matches it, thus selecting configuration B as the target configuration. The startup loader switches configuration B to the current display configuration, removes configuration A from the configuration file, and points the display controller output link to the LVDS channel of configuration B. The display driver then initializes according to the timing parameters of configuration B, and the screen displays a 1024x768 image normally. If the screen is subsequently changed back to 1024x600, simply run the configuration tool again, select 1024x600, restart, and the startup loader will read 0x00 and automatically switch back to configuration A.
[0024] By decoupling resolution selection from firmware versions and controlling it independently with a non-volatile flag, the same firmware can be compatible with multiple LVDS screens without modification, reducing the number of firmware versions to maintain. Since the switching action is completed before the display initialization during the boot process, it avoids the problem of modifying the resolution after the operating system starts, which cannot correct the underlying timing parameters, thus preventing black screens and screen distortions caused by timing mismatches. Production lines and after-sales service only need to run a configuration tool under the operating system to write the flag and restart, eliminating the need for programmers or professional debugging tools, lowering the operational threshold for on-site maintenance and reducing equipment return rates. The default configuration mechanism ensures that the device can still display normally even if the flag is not written or fails to be read, improving the fault tolerance and reliability of the mass production process. Furthermore, when adding a new screen model, only a set of preset flags and corresponding display configurations need to be added to the configuration file; the overall method and framework remain unchanged.
[0025] In one embodiment, matching the resolution identifier with multiple preset identifiers by launching the loader includes: By starting the loader, multiple alternative display configurations are obtained, each associated with a preset identifier, resulting in a set of preset identifiers; By starting the loading program, the resolution identifier is compared with each preset identifier in the preset identifier set in turn to obtain the comparison result. If the comparison results show that there is a preset identifier that matches the resolution identifier, then the matching result indicates that the match is successful; If the comparison result indicates that there is no preset identifier in the preset identifier set that matches the resolution identifier, then the matching result indicates that the matching has failed.
[0026] After the startup loader reads the resolution identifier from the identifier storage area, establishing a correct correspondence between this identifier and the multiple preset alternative display configurations in the startup configuration file is crucial for determining the accuracy of subsequent target configuration switching. Since the identifier storage area may contain outliers due to write errors, storage media failures, or data corruption, and the number of alternative display configurations in the startup configuration file may dynamically expand with product models, a reliable matching mechanism is needed. This mechanism should accurately identify the configuration corresponding to a valid identifier while handling invalid or empty identifiers, preventing the startup loader from entering an abnormal state due to matching failures. This embodiment sequentially compares the preset identifiers of all alternative configurations, clearly distinguishing between successful and unsuccessful matching based on the comparison results, providing a definite basis for selecting the subsequent target configuration.
[0027] Specifically, after obtaining the resolution identifier from the identifier storage area, the startup loader first accesses multiple alternative display configurations in the startup configuration file. From each alternative display configuration, it extracts its pre-associated preset identifier, which together form a preset identifier set. Using this resolution identifier as the target comparison value, the startup loader sequentially performs a consistency comparison between each preset identifier in the preset identifier set and the resolution identifier. Each comparison produces a comparison result, reflecting whether the currently compared preset identifier is completely consistent with the resolution identifier. The startup loader traverses the preset identifier set sequentially until a comparison result is found to be consistent or all preset identifiers have been compared.
[0028] If the comparison result shows that there is a preset identifier in the preset identifier set that matches the resolution identifier, the startup loading program determines that the match is successful and records the candidate display configuration to which the matching preset identifier belongs as the matching configuration. This matching configuration is used as the target configuration later. If, after the startup loading program has traversed all preset identifiers in the preset identifier set, the comparison result shows that there is no preset identifier that matches the resolution identifier, the startup loading program determines that the match is unsuccessful. In addition, if the startup loading program encounters an empty identifier storage area or an error return when reading the resolution identifier from the identifier storage area, that is, the startup loading program has not actually obtained a valid resolution identifier, the startup loading program directly determines that the match is unsuccessful and does not need to perform subsequent consistency comparison actions. The matching success or failure is used as the matching result to guide the startup loading program in selecting the target configuration later. That is, if the match is successful, the matching configuration is selected as the target configuration; if the match fails, the default display configuration is selected as the target configuration.
[0029] Following the scenario of an embedded motherboard compatible with both 1024x600 and 1024x768 screens, the startup configuration file pre-sets configuration A with a preset identifier 0x00 and configuration B with a preset identifier 0x01. After the startup loader reads the EEPROM to obtain the resolution identifier 0x01, it extracts the preset identifiers 0x00 from configuration A and 0x01 from configuration B, obtaining a preset identifier set {0x00, 0x01}. The startup loader first compares the resolution identifier 0x01 with the preset identifier 0x00; if they don't match, it continues to compare the resolution identifier 0x01 with the preset identifier 0x01; if they match, the startup loader determines a successful match and identifies configuration B as the matching configuration. If the startup loader reads the EEPROM and obtains a resolution identifier 0x03, but 0x03 is not present in the preset identifier set, the startup loader completes all comparisons and confirms that no matching preset identifier exists, thus determining a mismatch. If the EEPROM is empty or the read timeout occurs, the startup loading program will also determine that the match has failed, and the default display configuration, i.e., configuration A, will be selected to ensure that the device can still display normally.
[0030] This embodiment achieves deterministic matching of identifiers for any resolution by setting a predefined identifier set and comparing them sequentially. Regardless of whether the value in the identifier storage area is valid, invalid, or null, a clear conclusion of successful or failed matching is obtained, avoiding ambiguity or execution interruption in the startup loading program due to identifier anomalies. For new screen models, only a new predefined identifier and its associated configuration need to be added to the predefined identifier set; the matching process itself requires no modification, demonstrating good scalability. This matching mechanism is completed during the startup loading program phase, does not rely on operating system or file system support, has high execution efficiency and minimal overhead, making it suitable for resource-constrained embedded startup environments.
[0031] In one embodiment, reconstructing the startup configuration file according to the target configuration includes: The startup loader switches the current display configuration in the startup configuration file to the target configuration, resulting in a switched startup configuration file. The switched startup configuration file includes the target configuration and other alternative display configurations besides the target configuration. By starting the loader, all alternative display configurations other than the target configuration are removed from the switched startup configuration file, resulting in a startup configuration file that contains only the target configuration. By launching the loader, the output links of the display controller will be directed to the connections defined in the target configuration file, which contains only the target configuration, in order to complete the reconstruction of the startup configuration file.
[0032] After the startup loader selects the target configuration, the startup configuration file still contains the target configuration and other unselected alternative display configurations. If the operating system is started directly without processing the startup configuration file, the display driver may load the wrong configuration due to the coexistence of multiple available configurations when parsing the startup configuration file, or the display subsystem in the operating system kernel may still reference the old configuration originally associated with the display controller output, causing a mismatch between the underlying timing parameters and the screen's physical specifications. To solve this problem, this embodiment performs three progressively advancing operations on the configuration file: configuration switching, removal of irrelevant configurations, and output link redirection, ensuring that the startup configuration file obtained by the operating system is a unique and correct display link.
[0033] Specifically, after the startup loader selects a target configuration, it sets that target configuration as the current display configuration in the startup configuration file, completing the switch from the original current display configuration to the target configuration. The resulting startup configuration file contains the target configuration and all other unselected alternative display configurations. Essentially, this switch changes the flag or pointer to the currently valid configuration in the startup configuration file, making it point from the original configuration to the target configuration, while other configuration content is temporarily retained in the configuration file.
[0034] After the startup loader completes the switch, it identifies and removes all alternative display configurations other than the target configuration from the new startup configuration file. The result is a startup configuration file containing only the target configuration. This removal operation reduces the size of the startup configuration file and eliminates the potential risk of the display driver mistakenly selecting a different configuration after the operating system starts, ensuring that the operating system can only recognize the unique target configuration when parsing the configuration file.
[0035] After removing the configuration, the bootloader points the display controller's output links to the connection defined in the target configuration file, which contains only the target configuration. This connection is specifically the LVDS signal transmission channel predefined in the target configuration, representing the signal routing relationship between the display controller's output and the LVDS interface. Through this pointing action, the display controller's output signals are routed at the hardware level to the LVDS signal transmission channel corresponding to the target configuration, completing the reconstruction of the boot configuration file. After reconstruction, the boot configuration file contains only the target configuration, and a definite one-to-one correspondence is established between the display controller's output links and the target configuration. Upon operating system startup, the display driver directly performs initialization based on this reconstructed configuration file.
[0036] Following the scenario of using an embedded motherboard compatible with both 1024x600 and 1024x768 screens, the startup configuration file pre-sets configurations A and B. The current display configuration is configuration A, and the display controller's output link is connected to the LVDS channel of configuration A by default. After the startup loader selects configuration B as the target configuration, it first switches the current display configuration from configuration A to configuration B. After the switch, the configuration file contains both configurations A and B. The startup loader then removes configuration A from the configuration file, resulting in a configuration file containing only configuration B. Finally, the startup loader changes the display controller's output link from the LVDS channel originally pointing to configuration A to the LVDS channel of configuration B, completing the reconstruction. After the operating system boots, the display driver reads this configuration file containing only configuration B, initializes the display controller according to the LVDS timing parameters of configuration B, and the LVDS signal output by the display controller is transmitted to the 1024x768 screen via the re-directed output link, resulting in normal image display. If the screen is subsequently changed to 1024x600, the startup loading program will switch configuration A to the target configuration and remove configuration B, while redirecting the output link to the LVDS channel of configuration A.
[0037] By performing three-layer operations—switching the current display configuration, removing other configurations, and redirecting the output link—a complete reconstruction of the startup configuration file is achieved, transforming it from a state of multiple concurrent configurations to a single valid configuration. This ensures that the operating system can only recognize and load the target configuration after startup, eliminating display anomalies caused by multiple configuration conflicts or incorrect configuration references by the display controller. The order of switching before removing ensures that the switching operation is completed within the complete configuration set, avoiding the unavailability of the switching target due to direct configuration deletion. The separate redirection operation of the output link clearly distinguishes between the configuration selection at the logical level of the configuration file and the signal routing at the physical level of the hardware, decoupling configuration switching from link switching and improving the reliability and readability of the reconstruction process. This reconstruction operation is completed during the startup loader phase and is completely transparent to the operating system. The operating system does not need to be aware of the existence of multiple underlying configurations and only performs display initialization according to the single final configuration provided.
[0038] In one embodiment, the display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen, including: The target display parameter set is obtained by extracting the LVDS timing parameters, backlight control parameters, and power control parameters contained in the target configuration from the reconstructed startup configuration file through the display driver. The display driver initializes the LVDS output timing, backlight voltage, and power timing according to the target display parameter set to drive the screen to output a target resolution image.
[0039] After the startup loader completes the reconstruction of the startup configuration file, the reconstructed startup configuration file only contains the target configuration, and the output link of the display controller is now pointed to the LVDS signal transmission channel defined by the target configuration. However, the reconstruction of the configuration file only completes the display link setting at the logical level; the physical hardware of the display controller and the screen has not yet been actually initialized according to the parameters of the target configuration. Normal display of an LVDS screen requires the display controller to output a clock frequency and synchronization signal that conforms to the screen specifications. Simultaneously, the backlight power supply and the screen main power supply need to be powered on in the correct timing sequence. Deviation of any parameter may cause the screen to fail to display or display abnormalities. Since these parameters act on different hardware modules such as the display controller, backlight driver circuit, and screen power management circuit, and there are timing coordination requirements between them, the display driver of the operating system needs to uniformly complete the extraction and initialization work. This embodiment achieves the target resolution image output of the screen through two stages: parameter extraction and hardware initialization.
[0040] Specifically, after the operating system boots, the display driver in the operating system reads the reconstructed boot configuration file, locates the target configuration from the reconstructed boot configuration file, and extracts LVDS timing parameters, backlight control parameters, and power control parameters from the target configuration. LVDS timing parameters include parameters used to define the timing of the LVDS output signals, such as pixel clock frequency, horizontal sync width, horizontal leading and trailing edges, vertical sync width, and vertical leading and trailing edges. Backlight control parameters include the polarity definition of the backlight enable signal and the backlight brightness adjustment method. Power control parameters include the power-on delay time of the screen's main power supply and the effective level of the power enable signal. The display driver summarizes the three types of parameters extracted above to form a target display parameter set, which completely describes all the hardware control information required to drive the screen.
[0041] After obtaining the target display parameter set, the display driver first enables the screen's main power supply according to the power control parameters in the target display parameter set, and waits for the power-on stabilization delay time specified in the power control parameters to ensure that the internal circuitry of the screen completes power-on reset. After the screen's main power supply stabilizes, the display driver configures the output clock frequency and synchronization signal timing of the display controller according to the LVDS timing parameters, causing the display controller to start outputting LVDS differential signals that meet the target configuration requirements. After the LVDS signal output stabilizes, the display driver enables the backlight power supply and sets the backlight brightness according to the backlight control parameters, completing all hardware initialization actions. In some implementation scenarios, the display driver can also perform the above initialization actions simultaneously or in other orders, as long as the screen's main power supply reaches a stable state before the LVDS signal and backlight enable. Through the initialization process, the LVDS signal output by the display controller is transmitted to the screen via the output link redirected by the startup loading program, and the screen displays the target resolution image under the correct power timing and backlight coordination.
[0042] Following the scenario of switching from an embedded motherboard to a 1024x768 screen, the reconstructed startup configuration file only contains Configuration B. The target display parameter set in Configuration B includes the following parameters: In the LVDS timing parameters, the pixel clock frequency is set to 65MHz, the horizontal effective pixels are 1024, and the vertical effective pixels are 768; the backlight control parameters set the backlight enable signal to be active high. The power control parameters specify a 10-millisecond delay after enabling the screen's main power before configuring the LVDS timing. After reading the reconstructed startup configuration file, the display driver extracts the above parameters from Configuration B to form the target display parameter set. Subsequently, the display driver first pulls the screen's main power enable pin high according to the power control parameters, waits 10 milliseconds, and then configures the display controller's pixel clock and synchronization signal timing according to the LVDS timing parameters. Finally, it pulls the backlight enable pin high according to the backlight control parameters, and the screen lights up normally and displays a 1024x768 image. If the screen resolution is 1024x600, then the corresponding configuration A includes a pixel clock frequency setting of 50MHz, a horizontal effective pixel count of 1024, a vertical effective pixel count of 600, and corresponding power and backlight parameters. The display driver executes the same initialization process according to different parameter values.
[0043] By extracting all display-related parameters from the target configuration in a unified manner through the display driver and initializing each hardware module sequentially, the problem of initialization omissions or inconsistencies caused by parameters being scattered across multiple configuration locations is avoided. The display driver performs initialization in the order of power priority, timing second, and backlight last, ensuring that the screen receives LVDS signals and lights up the backlight under the correct power state, avoiding screen damage or momentary display abnormalities caused by improper timing sequence. This initialization process is completely transparent to other subsystems of the operating system. The display driver only needs to read the reconstructed single configuration file to complete all initialization actions without being aware of the underlying process of switching between multiple configurations. Since the bootloader has completed the output link redirection, the display driver does not need to configure signal routing to output LVDS signals to the correct physical channel, further simplifying the display driver's initialization logic.
[0044] Reference Figure 2 The diagram shown is a functional module schematic of the screen resolution configuration switching device 100 of this application.
[0045] Depending on the functions implemented, the screen resolution configuration switching device 100 includes a writing module 110, a reading module 120, a matching module 130, a switching module 140, and an output module 150. These modules can also be referred to as units, which are a series of computer program segments that can be executed by the electronic device's processor and perform a fixed function, stored in the electronic device's memory.
[0046] In this embodiment, the functions of each module / unit are as follows: Writing module 110: In response to an externally input target resolution, writes a resolution identifier corresponding to the target resolution to a pre-set identifier storage area; Reading module 120: used to obtain the resolution identifier by reading the identifier storage area through the startup loading program during the startup phase of the electronic device and before display initialization; Matching module 130: used to match the resolution identifier with multiple preset identifiers by starting the loading program, and determine the target configuration based on the matching result; Switching module 140: used to switch the current display configuration in the startup configuration file to the target configuration through the startup loader, and reconstruct the startup configuration file according to the target configuration; Output module 150: Used to start the operating system. The display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen.
[0047] The specific implementation of the screen resolution configuration switching device of this application is largely the same as the specific implementation of the screen resolution configuration switching method described above, and will not be repeated here.
[0048] Reference Figure 3 The diagram shown is a schematic representation of a preferred embodiment of the electronic device of this application.
[0049] The electronic device includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114. Memory 113 is used to store computer programs, such as a screen resolution configuration switching program; Figure 3 Only an electronic device having a processor 111, a communication interface 112, a memory 113 and a communication bus 114 is shown. However, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0050] In one embodiment of this application, when the processor 111 executes a program stored in the memory 113, it implements the screen resolution configuration switching method provided in any of the foregoing method embodiments, including: In response to an externally input target resolution, a resolution identifier corresponding to the target resolution is written to a pre-set identifier storage area; During the startup phase of the electronic device and before display initialization, the resolution identifier is obtained by reading the identifier storage area through the startup loading program; The resolution identifier is matched with multiple preset identifiers by starting the loading program, and the target configuration is determined based on the matching results; The startup loader switches the current display configuration in the startup configuration file to the target configuration and reconstructs the startup configuration file according to the target configuration. The operating system starts, and the display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen.
[0051] For a detailed description of the above steps, please refer to the flowchart of the above embodiment of the screen resolution configuration switching method.
[0052] Furthermore, this application also proposes a computer-readable storage medium that is both non-volatile and volatile. This computer-readable storage medium is any one or any combination of several of the following: hard disk, multimedia card, SD card, flash memory card, SMC, read-only memory (ROM), erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB memory, etc. The computer-readable storage medium includes a data storage area and a program storage area. The program storage area stores a screen resolution configuration switching program, which, when executed by a processor, performs the following operations: In response to an externally input target resolution, a resolution identifier corresponding to the target resolution is written to a pre-set identifier storage area; During the startup phase of the electronic device and before display initialization, the resolution identifier is obtained by reading the identifier storage area through the startup loading program; The resolution identifier is matched with multiple preset identifiers by starting the loading program, and the target configuration is determined based on the matching results; The startup loader switches the current display configuration in the startup configuration file to the target configuration and reconstructs the startup configuration file according to the target configuration. The operating system starts, and the display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen.
[0053] The specific implementation of the computer-readable storage medium in this application is largely the same as the specific implementation of the screen resolution configuration switching method described above, and will not be repeated here.
[0054] It should be noted that the sequence numbers of the embodiments in this application are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0055] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware simulation platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0056] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for switching screen resolution configurations, characterized in that, The method includes: In response to an externally input target resolution, a resolution identifier corresponding to the target resolution is written to a pre-set identifier storage area; During the startup phase of the electronic device and before display initialization, the resolution identifier is obtained by reading the identifier storage area through the startup loading program; The resolution identifier is matched with multiple preset identifiers by starting the loading program, and the target configuration is determined based on the matching results; The startup loader switches the current display configuration in the startup configuration file to the target configuration and reconstructs the startup configuration file according to the target configuration. The operating system starts, and the display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen.
2. The screen resolution configuration switching method as described in claim 1, characterized in that, Prior to responding to the target resolution of an external input, the method further includes: An identifier storage area is partitioned in the non-volatile storage medium of the electronic device, and multiple alternative display configurations and a default display configuration are preset in the startup configuration file of the startup loader. Each alternative display configuration is associated with a corresponding preset identifier.
3. The screen resolution configuration switching method as described in claim 2, characterized in that, The step of matching the resolution identifier with multiple preset identifiers by starting the loading program includes: By starting the loader, multiple alternative display configurations are obtained, each associated with a preset identifier, resulting in a set of preset identifiers; By starting the loading program, the resolution identifier is compared with each preset identifier in the preset identifier set in turn to obtain the comparison result. If the comparison results show that there is a preset identifier that matches the resolution identifier, then the matching result indicates that the match is successful; If the comparison result indicates that there is no preset identifier in the preset identifier set that matches the resolution identifier, then the matching result indicates that the matching has failed.
4. The screen resolution configuration switching method as described in claim 3, characterized in that, The step of determining the target configuration based on the matching results includes: If a match is found, the matching configuration is selected from the candidate display configurations as the target configuration. If a match fails or no valid identifier is read, the default display configuration is selected as the target configuration.
5. The screen resolution configuration switching method as described in claim 1, characterized in that, The step of reconstructing the startup configuration file according to the target configuration includes: The startup loader switches the current display configuration in the startup configuration file to the target configuration, resulting in a switched startup configuration file. The switched startup configuration file includes the target configuration and other alternative display configurations besides the target configuration. By starting the loader, all alternative display configurations other than the target configuration are removed from the switched startup configuration file, resulting in a startup configuration file that contains only the target configuration. By launching the loader, the output links of the display controller will be directed to the connections defined in the target configuration file, which contains only the target configuration, in order to complete the reconstruction of the startup configuration file.
6. The screen resolution configuration switching method as described in claim 1, characterized in that, The display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen, including: The target display parameter set is obtained by extracting the LVDS timing parameters, backlight control parameters, and power control parameters contained in the target configuration from the reconstructed startup configuration file through the display driver. The display driver initializes the LVDS output timing, backlight voltage, and power timing according to the target display parameter set to drive the screen to output a target resolution image.
7. The method for switching screen resolution configuration as described in any one of claims 1 to 6, characterized in that, The target configuration includes at least one of screen number, LVDS timing parameters, backlight control parameters, and power control parameters.
8. A screen resolution configuration switching device, characterized in that, The device includes: Write module: In response to an externally input target resolution, write a resolution identifier corresponding to the target resolution to a pre-set identifier storage area; Reading module: used to obtain the resolution identifier by reading the identifier storage area through the startup loading program during the startup phase of the electronic device and before display initialization; Matching module: used to match the resolution identifier with multiple preset identifiers by starting the loading program, and determine the target configuration based on the matching results; Switching module: used to switch the current display configuration in the startup configuration file to the target configuration through the startup loader, and reconstruct the startup configuration file according to the target configuration; Output module: Used to start the operating system. The display driver initializes the timing and control parameters according to the reconstructed startup configuration file to output the target resolution image on the screen.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the screen resolution configuration switching method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the screen resolution configuration switching method as described in any one of claims 1 to 7.
