Skip to content

Commit

Permalink
Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu
Browse files Browse the repository at this point in the history
…into drm-next

fsl-dcu pixel clock polarity support
* 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu:
  drm/fsl-dcu: use bus_flags for pixel clock polarity
  drm: introduce bus_flags in drm_display_info
  • Loading branch information
Dave Airlie committed May 6, 2016
2 parents a64424d + 2c80661 commit fd50c3a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
struct drm_connector *con = &fsl_dev->connector.base;
struct drm_display_mode *mode = &crtc->state->mode;
unsigned int hbp, hfp, hsw, vbp, vfp, vsw, index, pol = 0;

Expand All @@ -80,6 +81,10 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
vfp = mode->vsync_start - mode->vdisplay;
vsw = mode->vsync_end - mode->vsync_start;

/* INV_PXCK as default (most display sample data on rising edge) */
if (!(con->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE))
pol |= DCU_SYN_POL_INV_PXCK;

if (mode->flags & DRM_MODE_FLAG_NHSYNC)
pol |= DCU_SYN_POL_INV_HS_LOW;

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
#define DCU_VSYN_PARA_FP(x) (x)

#define DCU_SYN_POL 0x0024
#define DCU_SYN_POL_INV_PXCK_FALL (0 << 6)
#define DCU_SYN_POL_NEG_REMAIN (0 << 5)
#define DCU_SYN_POL_INV_PXCK BIT(6)
#define DCU_SYN_POL_NEG BIT(5)
#define DCU_SYN_POL_INV_VS_LOW BIT(1)
#define DCU_SYN_POL_INV_HS_LOW BIT(0)

Expand Down
5 changes: 4 additions & 1 deletion drivers/gpu/drm/panel/panel-simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ struct panel_desc {
} delay;

u32 bus_format;
u32 bus_flags;
};

struct panel_simple {
Expand Down Expand Up @@ -144,6 +145,7 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
if (panel->desc->bus_format)
drm_display_info_set_bus_formats(&connector->display_info,
&panel->desc->bus_format, 1);
connector->display_info.bus_flags = panel->desc->bus_flags;

return num;
}
Expand Down Expand Up @@ -1051,7 +1053,8 @@ static const struct panel_desc nec_nl4827hc19_05b = {
.width = 95,
.height = 54,
},
.bus_format = MEDIA_BUS_FMT_RGB888_1X24
.bus_format = MEDIA_BUS_FMT_RGB888_1X24,
.bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
};

static const struct display_timing okaya_rs800480t_7x0gp_timing = {
Expand Down
9 changes: 9 additions & 0 deletions include/drm/drm_crtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ enum subpixel_order {
#define DRM_COLOR_FORMAT_RGB444 (1<<0)
#define DRM_COLOR_FORMAT_YCRCB444 (1<<1)
#define DRM_COLOR_FORMAT_YCRCB422 (1<<2)

#define DRM_BUS_FLAG_DE_LOW (1<<0)
#define DRM_BUS_FLAG_DE_HIGH (1<<1)
/* drive data on pos. edge */
#define DRM_BUS_FLAG_PIXDATA_POSEDGE (1<<2)
/* drive data on neg. edge */
#define DRM_BUS_FLAG_PIXDATA_NEGEDGE (1<<3)

/*
* Describes a given display (e.g. CRT or flat panel) and its limitations.
*/
Expand All @@ -139,6 +147,7 @@ struct drm_display_info {

const u32 *bus_formats;
unsigned int num_bus_formats;
u32 bus_flags;

/* Mask of supported hdmi deep color modes */
u8 edid_hdmi_dc_modes;
Expand Down

0 comments on commit fd50c3a

Please sign in to comment.