1.1 --- a/pkg/devices/lib/lcd/include/lcd-jz4740-regs.h Fri Jan 14 23:15:46 2022 +0100
1.2 +++ b/pkg/devices/lib/lcd/include/lcd-jz4740-regs.h Wed Jan 19 00:03:42 2022 +0100
1.3 @@ -3,7 +3,7 @@
1.4 *
1.5 * Copyright (C) Xiangfu Liu <xiangfu@sharism.cc>
1.6 * Copyright (C) 2015, 2016, 2017, 2018, 2020,
1.7 - * 2021 Paul Boddie <paul@boddie.org.uk>
1.8 + * 2021, 2022 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -286,6 +286,8 @@
1.13
1.14 enum Position_bits : unsigned
1.15 {
1.16 + Position_alpha_mode = 31,
1.17 + Position_rgb = 30,
1.18 Position_bpp = 27,
1.19 Position_premultiply_lcd = 26,
1.20 Position_coefficient = 24,
1.21 @@ -293,13 +295,33 @@
1.22 Position_x_position = 0,
1.23 };
1.24
1.25 -enum Position_values : unsigned
1.26 +enum Position_alpha_mode_values : unsigned
1.27 +{
1.28 + Position_alpha_image = 0,
1.29 + Position_alpha_pixel = 1,
1.30 +};
1.31 +
1.32 +enum Position_rgb_values : unsigned
1.33 +{
1.34 + Position_rgb_565 = 0,
1.35 + Position_rgb_555 = 1,
1.36 +};
1.37 +
1.38 +enum Position_bpp_values : unsigned
1.39 {
1.40 Position_bpp_15_16bpp = 4,
1.41 Position_bpp_18_24bpp = 5,
1.42 Position_bpp_30bpp = 7,
1.43 };
1.44
1.45 +enum Position_coefficient_values : unsigned
1.46 +{
1.47 + Position_coefficient_0 = 0,
1.48 + Position_coefficient_1 = 1,
1.49 + Position_coefficient_alpha = 2,
1.50 + Position_coefficient_1_minus_alpha = 3,
1.51 +};
1.52 +
1.53 // Alpha and size.
1.54
1.55 enum Alpha_size_bits : unsigned
2.1 --- a/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Fri Jan 14 23:15:46 2022 +0100
2.2 +++ b/pkg/devices/lib/lcd/src/jz4740/lcd-jz4780.cc Wed Jan 19 00:03:42 2022 +0100
2.3 @@ -3,7 +3,7 @@
2.4 *
2.5 * Copyright (C) Xiangfu Liu <xiangfu@sharism.cc>
2.6 * Copyright (C) 2015, 2016, 2017, 2018, 2020,
2.7 - * 2021 Paul Boddie <paul@boddie.org.uk>
2.8 + * 2021, 2022 Paul Boddie <paul@boddie.org.uk>
2.9 *
2.10 * This program is free software; you can redistribute it and/or
2.11 * modify it under the terms of the GNU General Public License as
2.12 @@ -117,7 +117,7 @@
2.13 desc.offset = 0;
2.14 desc.page_width = 0;
2.15
2.16 - desc.command_position = (1U << Position_coefficient) |
2.17 + desc.command_position = (Position_coefficient_1 << Position_coefficient) |
2.18 _position_bpp();
2.19
2.20 desc.fg_size = (0xff << Alpha_size_alpha) |