@@ -75,6 +75,7 @@ struct output_config *new_output_config(const char *name) {
7575 oc -> max_render_time = -1 ;
7676 oc -> adaptive_sync = -1 ;
7777 oc -> render_bit_depth = RENDER_BIT_DEPTH_DEFAULT ;
78+ oc -> color_format = WLR_OUTPUT_COLOR_FORMAT_AUTO ;
7879 oc -> color_profile = COLOR_PROFILE_DEFAULT ;
7980 oc -> color_transform = NULL ;
8081 oc -> power = -1 ;
@@ -130,6 +131,9 @@ static void supersede_output_config(struct output_config *dst, struct output_con
130131 if (src -> render_bit_depth != RENDER_BIT_DEPTH_DEFAULT ) {
131132 dst -> render_bit_depth = RENDER_BIT_DEPTH_DEFAULT ;
132133 }
134+ if (src -> color_format != WLR_OUTPUT_COLOR_FORMAT_AUTO ) {
135+ dst -> color_format = WLR_OUTPUT_COLOR_FORMAT_AUTO ;
136+ }
133137 if (src -> color_profile != COLOR_PROFILE_DEFAULT ) {
134138 if (dst -> color_transform ) {
135139 wlr_color_transform_unref (dst -> color_transform );
@@ -207,6 +211,9 @@ static void merge_output_config(struct output_config *dst, struct output_config
207211 if (src -> render_bit_depth != RENDER_BIT_DEPTH_DEFAULT ) {
208212 dst -> render_bit_depth = src -> render_bit_depth ;
209213 }
214+ if (src -> color_format != WLR_OUTPUT_COLOR_FORMAT_AUTO ) {
215+ dst -> color_format = src -> color_format ;
216+ }
210217 if (src -> color_profile != COLOR_PROFILE_DEFAULT ) {
211218 if (src -> color_transform ) {
212219 wlr_color_transform_ref (src -> color_transform );
@@ -553,6 +560,9 @@ static void queue_output_config(struct output_config *oc,
553560 } else {
554561 wlr_output_state_set_render_format (pending , DRM_FORMAT_XRGB8888 );
555562 }
563+ if (oc && oc -> color_format != WLR_OUTPUT_COLOR_FORMAT_AUTO ) {
564+ wlr_output_state_set_color_format (pending , oc -> color_format );
565+ }
556566
557567 bool hdr = oc && oc -> hdr == 1 ;
558568 bool color_profile = oc && (oc -> color_transform != NULL
0 commit comments