@@ -645,29 +645,56 @@ int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi,
645
645
EXPORT_SYMBOL (mipi_dsi_set_maximum_return_packet_size );
646
646
647
647
/**
648
- * mipi_dsi_compression_mode () - enable/disable DSC on the peripheral
648
+ * mipi_dsi_compression_mode_ext () - enable/disable DSC on the peripheral
649
649
* @dsi: DSI peripheral device
650
650
* @enable: Whether to enable or disable the DSC
651
+ * @algo: Selected compression algorithm
652
+ * @pps_selector: Select PPS from the table of pre-stored or uploaded PPS entries
651
653
*
652
- * Enable or disable Display Stream Compression on the peripheral using the
653
- * default Picture Parameter Set and VESA DSC 1.1 algorithm.
654
+ * Enable or disable Display Stream Compression on the peripheral.
654
655
*
655
656
* Return: 0 on success or a negative error code on failure.
656
657
*/
657
- int mipi_dsi_compression_mode (struct mipi_dsi_device * dsi , bool enable )
658
+ int mipi_dsi_compression_mode_ext (struct mipi_dsi_device * dsi , bool enable ,
659
+ enum mipi_dsi_compression_algo algo ,
660
+ unsigned int pps_selector )
658
661
{
659
- /* Note: Needs updating for non-default PPS or algorithm */
660
- u8 tx [2 ] = { enable << 0 , 0 };
662
+ u8 tx [2 ] = { };
661
663
struct mipi_dsi_msg msg = {
662
664
.channel = dsi -> channel ,
663
665
.type = MIPI_DSI_COMPRESSION_MODE ,
664
666
.tx_len = sizeof (tx ),
665
667
.tx_buf = tx ,
666
668
};
667
- int ret = mipi_dsi_device_transfer (dsi , & msg );
669
+ int ret ;
670
+
671
+ if (algo > 3 || pps_selector > 3 )
672
+ return - EINVAL ;
673
+
674
+ tx [0 ] = (enable << 0 ) |
675
+ (algo << 1 ) |
676
+ (pps_selector << 4 );
677
+
678
+ ret = mipi_dsi_device_transfer (dsi , & msg );
668
679
669
680
return (ret < 0 ) ? ret : 0 ;
670
681
}
682
+ EXPORT_SYMBOL (mipi_dsi_compression_mode_ext );
683
+
684
+ /**
685
+ * mipi_dsi_compression_mode() - enable/disable DSC on the peripheral
686
+ * @dsi: DSI peripheral device
687
+ * @enable: Whether to enable or disable the DSC
688
+ *
689
+ * Enable or disable Display Stream Compression on the peripheral using the
690
+ * default Picture Parameter Set and VESA DSC 1.1 algorithm.
691
+ *
692
+ * Return: 0 on success or a negative error code on failure.
693
+ */
694
+ int mipi_dsi_compression_mode (struct mipi_dsi_device * dsi , bool enable )
695
+ {
696
+ return mipi_dsi_compression_mode_ext (dsi , enable , MIPI_DSI_COMPRESSION_DSC , 0 );
697
+ }
671
698
EXPORT_SYMBOL (mipi_dsi_compression_mode );
672
699
673
700
/**
0 commit comments