Commit 0aa8bdf2 authored by Deepak M's avatar Deepak M Committed by Jani Nikula

drm/i915/dsi: Using the bpp value wrt the pixel format

The bpp value which is used while calulating the txbyteclkhs values
should be wrt the pixel format value. Currently bpp is coming
from pipe config to calculate txbyteclkhs. Fix it in this patch.

V2: dsi_pixel_format_bpp is used to retrieve the bpp from pixel_format
	[Review: Jani]
Signed-off-by: default avatarDeepak M <m.deepak@intel.com>
Signed-off-by: default avatarYogesh Mohan Marimuthu <yogesh.mohan.marimuthu@intel.com>
Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
Tested-by: Mika Kahola <mika.kahola@intel.com> # BYT
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1455203007-10850-1-git-send-email-ramalingam.c@intel.com
parent d6e3af54
...@@ -785,10 +785,9 @@ static void set_dsi_timings(struct drm_encoder *encoder, ...@@ -785,10 +785,9 @@ static void set_dsi_timings(struct drm_encoder *encoder,
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
enum port port; enum port port;
unsigned int bpp = intel_crtc->config->pipe_bpp; unsigned int bpp = dsi_pixel_format_bpp(intel_dsi->pixel_format);
unsigned int lane_count = intel_dsi->lane_count; unsigned int lane_count = intel_dsi->lane_count;
u16 hactive, hfp, hsync, hbp, vfp, vsync, vbp; u16 hactive, hfp, hsync, hbp, vfp, vsync, vbp;
...@@ -859,7 +858,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder) ...@@ -859,7 +858,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode; const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode;
enum port port; enum port port;
unsigned int bpp = intel_crtc->config->pipe_bpp; unsigned int bpp = dsi_pixel_format_bpp(intel_dsi->pixel_format);
u32 val, tmp; u32 val, tmp;
u16 mode_hdisplay; u16 mode_hdisplay;
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#define DSI_DUAL_LINK_FRONT_BACK 1 #define DSI_DUAL_LINK_FRONT_BACK 1
#define DSI_DUAL_LINK_PIXEL_ALT 2 #define DSI_DUAL_LINK_PIXEL_ALT 2
int dsi_pixel_format_bpp(int pixel_format);
struct intel_dsi_host; struct intel_dsi_host;
struct intel_dsi { struct intel_dsi {
......
...@@ -440,10 +440,7 @@ struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id) ...@@ -440,10 +440,7 @@ struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)
intel_dsi->dual_link = mipi_config->dual_link; intel_dsi->dual_link = mipi_config->dual_link;
intel_dsi->pixel_overlap = mipi_config->pixel_overlap; intel_dsi->pixel_overlap = mipi_config->pixel_overlap;
if (intel_dsi->pixel_format == VID_MODE_FORMAT_RGB666) bits_per_pixel = dsi_pixel_format_bpp(intel_dsi->pixel_format);
bits_per_pixel = 18;
else if (intel_dsi->pixel_format == VID_MODE_FORMAT_RGB565)
bits_per_pixel = 16;
intel_dsi->operation_mode = mipi_config->is_cmd_mode; intel_dsi->operation_mode = mipi_config->is_cmd_mode;
intel_dsi->video_mode_format = mipi_config->video_transfer_mode; intel_dsi->video_mode_format = mipi_config->video_transfer_mode;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "i915_drv.h" #include "i915_drv.h"
#include "intel_dsi.h" #include "intel_dsi.h"
static int dsi_pixel_format_bpp(int pixel_format) int dsi_pixel_format_bpp(int pixel_format)
{ {
int bpp; int bpp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment