]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/arm/malidp: Set the output_depth register in modeset
authorAyan Kumar Halder <ayan.halder@arm.com>
Tue, 15 May 2018 16:04:18 +0000 (17:04 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Thu, 5 Jul 2018 14:19:08 +0000 (15:19 +0100)
One needs to store the value of the OUTPUT_DEPTH that one has parsed from
device tree, so that it can be restored on system resume. This value is
set in the modeset function as this gets reset when the system suspends.

Signed-off-by: Ayan Kumar Halder <ayan.halder@arm.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
drivers/gpu/drm/arm/malidp_drv.c
drivers/gpu/drm/arm/malidp_hw.c
drivers/gpu/drm/arm/malidp_hw.h

index 125be226bf6c9712697e4cc5e705f8d4aa0b92ba..7237b98be5ebcd2d6b620ad49cf7d904208ba870 100644 (file)
@@ -715,6 +715,7 @@ static int malidp_bind(struct device *dev)
        for (i = 0; i < MAX_OUTPUT_CHANNELS; i++)
                out_depth = (out_depth << 8) | (output_width[i] & 0xf);
        malidp_hw_write(hwdev, out_depth, hwdev->hw->map.out_depth_base);
+       hwdev->output_color_depth = out_depth;
 
        atomic_set(&malidp->config_valid, MALIDP_CONFIG_VALID_INIT);
        init_waitqueue_head(&malidp->wq);
index 47fc112ee32e39d6a593242d54f16d8c827dbb4b..c94a4422e0e9100a607a8b817878c25942ce77bd 100644 (file)
@@ -244,6 +244,8 @@ static void malidp500_modeset(struct malidp_hw_device *hwdev, struct videomode *
 {
        u32 val = 0;
 
+       malidp_hw_write(hwdev, hwdev->output_color_depth,
+               hwdev->hw->map.out_depth_base);
        malidp_hw_clearbits(hwdev, MALIDP500_DC_CLEAR_MASK, MALIDP500_DC_CONTROL);
        if (mode->flags & DISPLAY_FLAGS_HSYNC_HIGH)
                val |= MALIDP500_HSYNCPOL;
@@ -520,6 +522,8 @@ static void malidp550_modeset(struct malidp_hw_device *hwdev, struct videomode *
 {
        u32 val = MALIDP_DE_DEFAULT_PREFETCH_START;
 
+       malidp_hw_write(hwdev, hwdev->output_color_depth,
+               hwdev->hw->map.out_depth_base);
        malidp_hw_write(hwdev, val, MALIDP550_DE_CONTROL);
        /*
         * Mali-DP550 and Mali-DP650 encode the background color like this:
index f5b3eab8398ba9fe91214752d5b89aa8b4d8c6ad..ad2e96915d44a253c8d77dc2e5d98c22c758fc5c 100644 (file)
@@ -230,6 +230,7 @@ struct malidp_hw_device {
 
        u8 min_line_size;
        u16 max_line_size;
+       u32 output_color_depth;
 
        /* track the device PM state */
        bool pm_suspended;