diff options
| author | Dave Airlie <airlied@redhat.com> | 2015-11-04 20:06:56 -0500 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2015-11-04 20:06:56 -0500 |
| commit | cb0fb271213e8a06ca8815a459dfaddd5bb47b4b (patch) | |
| tree | 068308d5dc785d8e3c0c4e003632ed817f4de8f3 /drivers/gpu | |
| parent | 793423ffcb229ae5654b382a1356906f81da2018 (diff) | |
| parent | a5f4185c4b8c131c0ccafa6b1b00cd4e5413e47e (diff) | |
Merge tag 'imx-drm-next-2015-10-30' of git://git.pengutronix.de/git/pza/linux into drm-next
imx-drm fixes and color format updates
- Some correctness fixes found by coccinelle
- Add drivers/gpu/ipu-v3 directory to MAINTAINERS
- Add support for more color formats
- Fix a regression, making displays larger than FullHD work again
* tag 'imx-drm-next-2015-10-30' of git://git.pengutronix.de/git/pza/linux:
drm/imx: hdmi: fix HDMI setup to allow modes larger than FullHD
gpu: ipu-v3: fix div_ratio type
gpu: ipu-v3: csi: add support for 8 bpp grayscale sensors.
drm/imx: enable ARGB4444 16-bit color format
gpu: ipu-v3: add support for ARGB4444 16-bit color format
drm/imx: ipuv3-plane: enable support for RGBX8888 and RGBA8888 pixel formats
gpu: ipu-v3: add support for RGBX8888 and RGBA8888 pixel formats
drm/imx: enable 15-bit RGB with 1-bit alpha formats
gpu: ipu-v3: add support for 15-bit RGB with 1-bit alpha formats
MAINTAINERS: Add IPUv3 core driver to the i.MX DRM driver section
gpu: ipu-v3: ipu-csi: bool test doesn't need a comparison to false
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/imx/dw_hdmi-imx.c | 16 | ||||
| -rw-r--r-- | drivers/gpu/drm/imx/ipuv3-plane.c | 16 | ||||
| -rw-r--r-- | drivers/gpu/ipu-v3/ipu-common.c | 5 | ||||
| -rw-r--r-- | drivers/gpu/ipu-v3/ipu-cpmem.c | 87 | ||||
| -rw-r--r-- | drivers/gpu/ipu-v3/ipu-csi.c | 5 |
5 files changed, 119 insertions, 10 deletions
diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c b/drivers/gpu/drm/imx/dw_hdmi-imx.c index 644edf65dbe0..98605ea2ad9d 100644 --- a/drivers/gpu/drm/imx/dw_hdmi-imx.c +++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c | |||
| @@ -48,11 +48,17 @@ static const struct dw_hdmi_mpll_config imx_mpll_cfg[] = { | |||
| 48 | { 0x40a2, 0x000a }, | 48 | { 0x40a2, 0x000a }, |
| 49 | }, | 49 | }, |
| 50 | }, { | 50 | }, { |
| 51 | ~0UL, { | 51 | 216000000, { |
| 52 | { 0x00a0, 0x000a }, | 52 | { 0x00a0, 0x000a }, |
| 53 | { 0x2001, 0x000f }, | 53 | { 0x2001, 0x000f }, |
| 54 | { 0x4002, 0x000f }, | 54 | { 0x4002, 0x000f }, |
| 55 | }, | 55 | }, |
| 56 | }, { | ||
| 57 | ~0UL, { | ||
| 58 | { 0x0000, 0x0000 }, | ||
| 59 | { 0x0000, 0x0000 }, | ||
| 60 | { 0x0000, 0x0000 }, | ||
| 61 | }, | ||
| 56 | } | 62 | } |
| 57 | }; | 63 | }; |
| 58 | 64 | ||
| @@ -82,7 +88,7 @@ static const struct dw_hdmi_curr_ctrl imx_cur_ctr[] = { | |||
| 82 | */ | 88 | */ |
| 83 | static const struct dw_hdmi_phy_config imx_phy_config[] = { | 89 | static const struct dw_hdmi_phy_config imx_phy_config[] = { |
| 84 | /*pixelclk symbol term vlev */ | 90 | /*pixelclk symbol term vlev */ |
| 85 | { 148500000, 0x800d, 0x0005, 0x01ad}, | 91 | { 216000000, 0x800d, 0x0005, 0x01ad}, |
| 86 | { ~0UL, 0x0000, 0x0000, 0x0000} | 92 | { ~0UL, 0x0000, 0x0000, 0x0000} |
| 87 | }; | 93 | }; |
| 88 | 94 | ||
| @@ -148,7 +154,8 @@ static enum drm_mode_status imx6q_hdmi_mode_valid(struct drm_connector *con, | |||
| 148 | { | 154 | { |
| 149 | if (mode->clock < 13500) | 155 | if (mode->clock < 13500) |
| 150 | return MODE_CLOCK_LOW; | 156 | return MODE_CLOCK_LOW; |
| 151 | if (mode->clock > 266000) | 157 | /* FIXME: Hardware is capable of 266MHz, but setup data is missing. */ |
| 158 | if (mode->clock > 216000) | ||
| 152 | return MODE_CLOCK_HIGH; | 159 | return MODE_CLOCK_HIGH; |
| 153 | 160 | ||
| 154 | return MODE_OK; | 161 | return MODE_OK; |
| @@ -159,7 +166,8 @@ static enum drm_mode_status imx6dl_hdmi_mode_valid(struct drm_connector *con, | |||
| 159 | { | 166 | { |
| 160 | if (mode->clock < 13500) | 167 | if (mode->clock < 13500) |
| 161 | return MODE_CLOCK_LOW; | 168 | return MODE_CLOCK_LOW; |
| 162 | if (mode->clock > 270000) | 169 | /* FIXME: Hardware is capable of 270MHz, but setup data is missing. */ |
| 170 | if (mode->clock > 216000) | ||
| 163 | return MODE_CLOCK_HIGH; | 171 | return MODE_CLOCK_HIGH; |
| 164 | 172 | ||
| 165 | return MODE_OK; | 173 | return MODE_OK; |
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 878a643d72e4..575f4c84388f 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c | |||
| @@ -23,12 +23,21 @@ | |||
| 23 | #define to_ipu_plane(x) container_of(x, struct ipu_plane, base) | 23 | #define to_ipu_plane(x) container_of(x, struct ipu_plane, base) |
| 24 | 24 | ||
| 25 | static const uint32_t ipu_plane_formats[] = { | 25 | static const uint32_t ipu_plane_formats[] = { |
| 26 | DRM_FORMAT_ARGB1555, | ||
| 26 | DRM_FORMAT_XRGB1555, | 27 | DRM_FORMAT_XRGB1555, |
| 28 | DRM_FORMAT_ABGR1555, | ||
| 27 | DRM_FORMAT_XBGR1555, | 29 | DRM_FORMAT_XBGR1555, |
| 30 | DRM_FORMAT_RGBA5551, | ||
| 31 | DRM_FORMAT_BGRA5551, | ||
| 32 | DRM_FORMAT_ARGB4444, | ||
| 28 | DRM_FORMAT_ARGB8888, | 33 | DRM_FORMAT_ARGB8888, |
| 29 | DRM_FORMAT_XRGB8888, | 34 | DRM_FORMAT_XRGB8888, |
| 30 | DRM_FORMAT_ABGR8888, | 35 | DRM_FORMAT_ABGR8888, |
| 31 | DRM_FORMAT_XBGR8888, | 36 | DRM_FORMAT_XBGR8888, |
| 37 | DRM_FORMAT_RGBA8888, | ||
| 38 | DRM_FORMAT_RGBX8888, | ||
| 39 | DRM_FORMAT_BGRA8888, | ||
| 40 | DRM_FORMAT_BGRA8888, | ||
| 32 | DRM_FORMAT_YUYV, | 41 | DRM_FORMAT_YUYV, |
| 33 | DRM_FORMAT_YVYU, | 42 | DRM_FORMAT_YVYU, |
| 34 | DRM_FORMAT_YUV420, | 43 | DRM_FORMAT_YUV420, |
| @@ -175,8 +184,15 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc, | |||
| 175 | ipu_dp_set_window_pos(ipu_plane->dp, crtc_x, crtc_y); | 184 | ipu_dp_set_window_pos(ipu_plane->dp, crtc_x, crtc_y); |
| 176 | /* Enable local alpha on partial plane */ | 185 | /* Enable local alpha on partial plane */ |
| 177 | switch (fb->pixel_format) { | 186 | switch (fb->pixel_format) { |
| 187 | case DRM_FORMAT_ARGB1555: | ||
| 188 | case DRM_FORMAT_ABGR1555: | ||
| 189 | case DRM_FORMAT_RGBA5551: | ||
| 190 | case DRM_FORMAT_BGRA5551: | ||
| 191 | case DRM_FORMAT_ARGB4444: | ||
| 178 | case DRM_FORMAT_ARGB8888: | 192 | case DRM_FORMAT_ARGB8888: |
| 179 | case DRM_FORMAT_ABGR8888: | 193 | case DRM_FORMAT_ABGR8888: |
| 194 | case DRM_FORMAT_RGBA8888: | ||
| 195 | case DRM_FORMAT_BGRA8888: | ||
| 180 | ipu_dp_set_global_alpha(ipu_plane->dp, false, 0, false); | 196 | ipu_dp_set_global_alpha(ipu_plane->dp, false, 0, false); |
| 181 | break; | 197 | break; |
| 182 | default: | 198 | default: |
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index e5a38d202a21..ba47b30d28fa 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c | |||
| @@ -57,10 +57,15 @@ EXPORT_SYMBOL_GPL(ipu_srm_dp_sync_update); | |||
| 57 | enum ipu_color_space ipu_drm_fourcc_to_colorspace(u32 drm_fourcc) | 57 | enum ipu_color_space ipu_drm_fourcc_to_colorspace(u32 drm_fourcc) |
| 58 | { | 58 | { |
| 59 | switch (drm_fourcc) { | 59 | switch (drm_fourcc) { |
| 60 | case DRM_FORMAT_ARGB1555: | ||
| 61 | case DRM_FORMAT_ABGR1555: | ||
| 62 | case DRM_FORMAT_RGBA5551: | ||
| 63 | case DRM_FORMAT_BGRA5551: | ||
| 60 | case DRM_FORMAT_RGB565: | 64 | case DRM_FORMAT_RGB565: |
| 61 | case DRM_FORMAT_BGR565: | 65 | case DRM_FORMAT_BGR565: |
| 62 | case DRM_FORMAT_RGB888: | 66 | case DRM_FORMAT_RGB888: |
| 63 | case DRM_FORMAT_BGR888: | 67 | case DRM_FORMAT_BGR888: |
| 68 | case DRM_FORMAT_ARGB4444: | ||
| 64 | case DRM_FORMAT_XRGB8888: | 69 | case DRM_FORMAT_XRGB8888: |
| 65 | case DRM_FORMAT_XBGR8888: | 70 | case DRM_FORMAT_XBGR8888: |
| 66 | case DRM_FORMAT_RGBX8888: | 71 | case DRM_FORMAT_RGBX8888: |
diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c index 3bf05bc4ab67..63eb16bf2cf0 100644 --- a/drivers/gpu/ipu-v3/ipu-cpmem.c +++ b/drivers/gpu/ipu-v3/ipu-cpmem.c | |||
| @@ -452,7 +452,7 @@ void ipu_cpmem_set_yuv_planar(struct ipuv3_channel *ch, | |||
| 452 | } | 452 | } |
| 453 | EXPORT_SYMBOL_GPL(ipu_cpmem_set_yuv_planar); | 453 | EXPORT_SYMBOL_GPL(ipu_cpmem_set_yuv_planar); |
| 454 | 454 | ||
| 455 | static const struct ipu_rgb def_rgb_32 = { | 455 | static const struct ipu_rgb def_xrgb_32 = { |
| 456 | .red = { .offset = 16, .length = 8, }, | 456 | .red = { .offset = 16, .length = 8, }, |
| 457 | .green = { .offset = 8, .length = 8, }, | 457 | .green = { .offset = 8, .length = 8, }, |
| 458 | .blue = { .offset = 0, .length = 8, }, | 458 | .blue = { .offset = 0, .length = 8, }, |
| @@ -460,7 +460,7 @@ static const struct ipu_rgb def_rgb_32 = { | |||
| 460 | .bits_per_pixel = 32, | 460 | .bits_per_pixel = 32, |
| 461 | }; | 461 | }; |
| 462 | 462 | ||
| 463 | static const struct ipu_rgb def_bgr_32 = { | 463 | static const struct ipu_rgb def_xbgr_32 = { |
| 464 | .red = { .offset = 0, .length = 8, }, | 464 | .red = { .offset = 0, .length = 8, }, |
| 465 | .green = { .offset = 8, .length = 8, }, | 465 | .green = { .offset = 8, .length = 8, }, |
| 466 | .blue = { .offset = 16, .length = 8, }, | 466 | .blue = { .offset = 16, .length = 8, }, |
| @@ -468,6 +468,22 @@ static const struct ipu_rgb def_bgr_32 = { | |||
| 468 | .bits_per_pixel = 32, | 468 | .bits_per_pixel = 32, |
| 469 | }; | 469 | }; |
| 470 | 470 | ||
| 471 | static const struct ipu_rgb def_rgbx_32 = { | ||
| 472 | .red = { .offset = 24, .length = 8, }, | ||
| 473 | .green = { .offset = 16, .length = 8, }, | ||
| 474 | .blue = { .offset = 8, .length = 8, }, | ||
| 475 | .transp = { .offset = 0, .length = 8, }, | ||
| 476 | .bits_per_pixel = 32, | ||
| 477 | }; | ||
| 478 | |||
| 479 | static const struct ipu_rgb def_bgrx_32 = { | ||
| 480 | .red = { .offset = 8, .length = 8, }, | ||
| 481 | .green = { .offset = 16, .length = 8, }, | ||
| 482 | .blue = { .offset = 24, .length = 8, }, | ||
| 483 | .transp = { .offset = 0, .length = 8, }, | ||
| 484 | .bits_per_pixel = 32, | ||
| 485 | }; | ||
| 486 | |||
| 471 | static const struct ipu_rgb def_rgb_24 = { | 487 | static const struct ipu_rgb def_rgb_24 = { |
| 472 | .red = { .offset = 16, .length = 8, }, | 488 | .red = { .offset = 16, .length = 8, }, |
| 473 | .green = { .offset = 8, .length = 8, }, | 489 | .green = { .offset = 8, .length = 8, }, |
| @@ -500,6 +516,46 @@ static const struct ipu_rgb def_bgr_16 = { | |||
| 500 | .bits_per_pixel = 16, | 516 | .bits_per_pixel = 16, |
| 501 | }; | 517 | }; |
| 502 | 518 | ||
| 519 | static const struct ipu_rgb def_argb_16 = { | ||
| 520 | .red = { .offset = 10, .length = 5, }, | ||
| 521 | .green = { .offset = 5, .length = 5, }, | ||
| 522 | .blue = { .offset = 0, .length = 5, }, | ||
| 523 | |||
