# HG changeset patch # User Paul Boddie # Date 1642547022 -3600 # Node ID e49ecec29e511a9d0bd82b13d9b316fe3db379f0 # Parent 74eafd298a88f963ee78311d5f6948f90b190143 Added more register field definitions. diff -r 74eafd298a88 -r e49ecec29e51 pkg/devices/lib/lcd/include/lcd-jz4740-regs.h --- a/pkg/devices/lib/lcd/include/lcd-jz4740-regs.h Fri Jan 14 23:15:46 2022 +0100 +++ b/pkg/devices/lib/lcd/include/lcd-jz4740-regs.h Wed Jan 19 00:03:42 2022 +0100 @@ -3,7 +3,7 @@ * * Copyright (C) Xiangfu Liu * Copyright (C) 2015, 2016, 2017, 2018, 2020, - * 2021 Paul Boddie + * 2021, 2022 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -286,6 +286,8 @@ enum Position_bits : unsigned { + Position_alpha_mode = 31, + Position_rgb = 30, Position_bpp = 27, Position_premultiply_lcd = 26, Position_coefficient = 24, @@ -293,13 +295,33 @@ Position_x_position = 0, }; -enum Position_values : unsigned +enum Position_alpha_mode_values : unsigned +{ + Position_alpha_image = 0, + Position_alpha_pixel = 1, +}; + +enum Position_rgb_values : unsigned +{ + Position_rgb_565 = 0, + Position_rgb_555 = 1, +}; + +enum Position_bpp_values : unsigned { Position_bpp_15_16bpp = 4, Position_bpp_18_24bpp = 5, Position_bpp_30bpp = 7, }; +enum Position_coefficient_values : unsigned +{ + Position_coefficient_0 = 0, + Position_coefficient_1 = 1, + Position_coefficient_alpha = 2, + Position_coefficient_1_minus_alpha = 3, +}; + // Alpha and size. enum Alpha_size_bits : unsigned diff -r 74eafd298a88 -r e49ecec29e51 pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Fri Jan 14 23:15:46 2022 +0100 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Wed Jan 19 00:03:42 2022 +0100 @@ -3,7 +3,7 @@ * * Copyright (C) Xiangfu Liu * Copyright (C) 2015, 2016, 2017, 2018, 2020, - * 2021 Paul Boddie + * 2021, 2022 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -117,7 +117,7 @@ desc.offset = 0; desc.page_width = 0; - desc.command_position = (1U << Position_coefficient) | + desc.command_position = (Position_coefficient_1 << Position_coefficient) | _position_bpp(); desc.fg_size = (0xff << Alpha_size_alpha) |