Skip to content

Commit

Permalink
Merge branch 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~dar…
Browse files Browse the repository at this point in the history
…rene/ti-linux-kernel/audio-display-linux-feature-tree into ti-linux-3.14.y

TI-Feature: audio-display
TI-Tree: git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree.git
TI-Branch: audio-display-ti-linux-3.14.y

* 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree:
  drm/omap: fix stride vs pixel size check
  OMAPDSS: DISPC: fix predecimation for YUV modes
  ARM: dts: dra7-evm: remove HDMI HPD pinmux
  ARM: dts: dra7-evm: remove vout1 pinmux
  drm/omap: add manager properties

Conflicts:
	arch/arm/boot/dts/dra7-evm.dts

Signed-off-by: Dan Murphy <[email protected]>
  • Loading branch information
Dan Murphy authored and Dan Murphy committed Mar 5, 2015
2 parents 72a9d1f + 74bf3e2 commit 406ea53
Show file tree
Hide file tree
Showing 8 changed files with 271 additions and 42 deletions.
144 changes: 109 additions & 35 deletions arch/arm/boot/dts/dra7-evm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@
tpd12s015: encoder@1 {
compatible = "ti,dra7evm-tpd12s015";

pinctrl-names = "default";
pinctrl-0 = <&hpd_pin>;

gpios = <&pcf_hdmi 4 0>, /* P4, CT CP HPD */
<&pcf_hdmi 5 0>, /* P5, LS OE */
<&gpio7 12 0>; /* gpio7_12/sp1_cs2, HPD */
Expand Down Expand Up @@ -218,43 +215,120 @@
>;
};

vout1_pins: pinmux_vout1_pins {
cpsw_default: cpsw_default {
pinctrl-single,pins = <
/* Slave 1 */
0x250 (PIN_OUTPUT | MUX_MODE0) /* rgmii1_tclk */
0x254 (PIN_OUTPUT | MUX_MODE0) /* rgmii1_tctl */
0x258 (PIN_OUTPUT | MUX_MODE0) /* rgmii1_td3 */
0x25c (PIN_OUTPUT | MUX_MODE0) /* rgmii1_td2 */
0x260 (PIN_OUTPUT | MUX_MODE0) /* rgmii1_td1 */
0x264 (PIN_OUTPUT | MUX_MODE0) /* rgmii1_td0 */
0x268 (PIN_INPUT | MUX_MODE0) /* rgmii1_rclk */
0x26c (PIN_INPUT | MUX_MODE0) /* rgmii1_rctl */
0x270 (PIN_INPUT | MUX_MODE0) /* rgmii1_rd3 */
0x274 (PIN_INPUT | MUX_MODE0) /* rgmii1_rd2 */
0x278 (PIN_INPUT | MUX_MODE0) /* rgmii1_rd1 */
0x27c (PIN_INPUT | MUX_MODE0) /* rgmii1_rd0 */

/* Slave 2 */
0x198 (PIN_OUTPUT | MUX_MODE3) /* rgmii2_tclk */
0x19c (PIN_OUTPUT | MUX_MODE3) /* rgmii2_tctl */
0x1a0 (PIN_OUTPUT | MUX_MODE3) /* rgmii2_td3 */
0x1a4 (PIN_OUTPUT | MUX_MODE3) /* rgmii2_td2 */
0x1a8 (PIN_OUTPUT | MUX_MODE3) /* rgmii2_td1 */
0x1ac (PIN_OUTPUT | MUX_MODE3) /* rgmii2_td0 */
0x1b0 (PIN_INPUT | MUX_MODE3) /* rgmii2_rclk */
0x1b4 (PIN_INPUT | MUX_MODE3) /* rgmii2_rctl */
0x1b8 (PIN_INPUT | MUX_MODE3) /* rgmii2_rd3 */
0x1bc (PIN_INPUT | MUX_MODE3) /* rgmii2_rd2 */
0x1c0 (PIN_INPUT | MUX_MODE3) /* rgmii2_rd1 */
0x1c4 (PIN_INPUT | MUX_MODE3) /* rgmii2_rd0 */
>;

};

cpsw_sleep: cpsw_sleep {
pinctrl-single,pins = <
/* Slave 1 */
0x250 (PIN_OFF_NONE)
0x254 (PIN_OFF_NONE)
0x258 (PIN_OFF_NONE)
0x25c (PIN_OFF_NONE)
0x260 (PIN_OFF_NONE)
0x264 (PIN_OFF_NONE)
0x268 (PIN_OFF_NONE)
0x26c (PIN_OFF_NONE)
0x270 (PIN_OFF_NONE)
0x274 (PIN_OFF_NONE)
0x278 (PIN_OFF_NONE)
0x27c (PIN_OFF_NONE)

/* Slave 1 */
0x198 (PIN_OFF_NONE)
0x19c (PIN_OFF_NONE)
0x1a0 (PIN_OFF_NONE)
0x1a4 (PIN_OFF_NONE)
0x1a8 (PIN_OFF_NONE)
0x1ac (PIN_OFF_NONE)
0x1b0 (PIN_OFF_NONE)
0x1b4 (PIN_OFF_NONE)
0x1b8 (PIN_OFF_NONE)
0x1bc (PIN_OFF_NONE)
0x1c0 (PIN_OFF_NONE)
0x1c4 (PIN_OFF_NONE)
>;
};

davinci_mdio_default: davinci_mdio_default {
pinctrl-single,pins = <
/* MDIO */
0x23c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_data */
0x240 (PIN_INPUT_PULLUP | MUX_MODE0) /* mdio_clk */
>;
};

davinci_mdio_sleep: davinci_mdio_sleep {
pinctrl-single,pins = <
0x23c (PIN_OFF_NONE)
0x240 (PIN_OFF_NONE)
>;
};

nand_flash_x16: nand_flash_x16 {
/* On DRA7 EVM, GPMC_WPN and NAND_BOOTn comes from DIP switch
* So NAND flash requires following switch settings:
* SW5.9 (GPMC_WPN) = LOW
* SW5.1 (NAND_BOOTn) = HIGH */
pinctrl-single,pins = <
0x1C8 (PIN_OUTPUT | MUX_MODE0) /* vout1_clk */
0x1CC (PIN_OUTPUT | MUX_MODE0) /* vout1_de */
0x1D0 (PIN_OUTPUT | MUX_MODE0) /* vout1_fld */
0x1D4 (PIN_OUTPUT | MUX_MODE0) /* vout1_hsync */
0x1D8 (PIN_OUTPUT | MUX_MODE0) /* vout1_vsync */
0x1DC (PIN_OUTPUT | MUX_MODE0) /* vout1_d0 */
0x1E0 (PIN_OUTPUT | MUX_MODE0) /* vout1_d1 */
0x1E4 (PIN_OUTPUT | MUX_MODE0) /* vout1_d2 */
0x1E8 (PIN_OUTPUT | MUX_MODE0) /* vout1_d3 */
0x1EC (PIN_OUTPUT | MUX_MODE0) /* vout1_d4 */
0x1F0 (PIN_OUTPUT | MUX_MODE0) /* vout1_d5 */
0x1F4 (PIN_OUTPUT | MUX_MODE0) /* vout1_d6 */
0x1F8 (PIN_OUTPUT | MUX_MODE0) /* vout1_d7 */
0x1FC (PIN_OUTPUT | MUX_MODE0) /* vout1_d8 */
0x200 (PIN_OUTPUT | MUX_MODE0) /* vout1_d9 */
0x204 (PIN_OUTPUT | MUX_MODE0) /* vout1_d10 */
0x208 (PIN_OUTPUT | MUX_MODE0) /* vout1_d11 */
0x20C (PIN_OUTPUT | MUX_MODE0) /* vout1_d12 */
0x210 (PIN_OUTPUT | MUX_MODE0) /* vout1_d13 */
0x214 (PIN_OUTPUT | MUX_MODE0) /* vout1_d14 */
0x218 (PIN_OUTPUT | MUX_MODE0) /* vout1_d15 */
0x21C (PIN_OUTPUT | MUX_MODE0) /* vout1_d16 */
0x220 (PIN_OUTPUT | MUX_MODE0) /* vout1_d17 */
0x224 (PIN_OUTPUT | MUX_MODE0) /* vout1_d18 */
0x228 (PIN_OUTPUT | MUX_MODE0) /* vout1_d19 */
0x22C (PIN_OUTPUT | MUX_MODE0) /* vout1_d20 */
0x230 (PIN_OUTPUT | MUX_MODE0) /* vout1_d21 */
0x234 (PIN_OUTPUT | MUX_MODE0) /* vout1_d22 */
0x238 (PIN_OUTPUT | MUX_MODE0) /* vout1_d23 */
0x0 (PIN_INPUT | MUX_MODE0) /* gpmc_ad0 */
0x4 (PIN_INPUT | MUX_MODE0) /* gpmc_ad1 */
0x8 (PIN_INPUT | MUX_MODE0) /* gpmc_ad2 */
0xc (PIN_INPUT | MUX_MODE0) /* gpmc_ad3 */
0x10 (PIN_INPUT | MUX_MODE0) /* gpmc_ad4 */
0x14 (PIN_INPUT | MUX_MODE0) /* gpmc_ad5 */
0x18 (PIN_INPUT | MUX_MODE0) /* gpmc_ad6 */
0x1c (PIN_INPUT | MUX_MODE0) /* gpmc_ad7 */
0x20 (PIN_INPUT | MUX_MODE0) /* gpmc_ad8 */
0x24 (PIN_INPUT | MUX_MODE0) /* gpmc_ad9 */
0x28 (PIN_INPUT | MUX_MODE0) /* gpmc_ad10 */
0x2c (PIN_INPUT | MUX_MODE0) /* gpmc_ad11 */
0x30 (PIN_INPUT | MUX_MODE0) /* gpmc_ad12 */
0x34 (PIN_INPUT | MUX_MODE0) /* gpmc_ad13 */
0x38 (PIN_INPUT | MUX_MODE0) /* gpmc_ad14 */
0x3c (PIN_INPUT | MUX_MODE0) /* gpmc_ad15 */
0xd8 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0 */
0xcc (PIN_OUTPUT | MUX_MODE0) /* gpmc_wen */
0xb4 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* gpmc_csn0 */
0xc4 (PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale */
0xc8 (PIN_OUTPUT | MUX_MODE0) /* gpmc_oen_ren */
0xd0 (PIN_OUTPUT | MUX_MODE0) /* gpmc_be0n_cle */
>;
};

hpd_pin: pinmux_hpd_pin {
tsc_pins: pinmux_tsc_pins {
pinctrl-single,pins = <
0x3b8 (PIN_INPUT_PULLDOWN | MUX_MODE14) /* gpio7_12 */
0x420 (PIN_INPUT_PULLUP | MUX_MODE1) /* sys_nirq2 */
>;
};

Expand Down
5 changes: 5 additions & 0 deletions arch/arm/boot/dts/dra72-evm-lcd10.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@

#include "dra72-evm.dts"
#include "dra7xx-evm-lcd10.dtsi"

&dss {
pinctrl-names = "default";
pinctrl-0 = <&vout1_pins>;
};
5 changes: 5 additions & 0 deletions arch/arm/boot/dts/dra72-evm-lcd7.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@

#include "dra72-evm.dts"
#include "dra7xx-evm-lcd7.dtsi"

&dss {
pinctrl-names = "default";
pinctrl-0 = <&vout1_pins>;
};
3 changes: 0 additions & 3 deletions arch/arm/boot/dts/dra7xx-evm-lcd10.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
};

&dss {
pinctrl-names = "default";
pinctrl-0 = <&vout1_pins>;

ports {
#address-cells = <1>;
#size-cells = <0>;
Expand Down
110 changes: 109 additions & 1 deletion drivers/gpu/drm/omapdrm/omap_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct omap_crtc {
bool go_bit_set;

struct omap_drm_apply apply;
struct omap_drm_apply mgr_apply;

struct omap_drm_irq apply_irq;
struct omap_drm_irq error_irq;
Expand Down Expand Up @@ -437,13 +438,46 @@ static int omap_crtc_set_property(struct drm_crtc *crtc,
{
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
struct omap_drm_private *priv = crtc->dev->dev_private;
struct omap_overlay_manager_info *info = &omap_crtc->info;
bool mgr_property = false;

if (property == priv->rotation_prop) {
crtc->invert_dimensions =
!!(val & ((1LL << DRM_ROTATE_90) | (1LL << DRM_ROTATE_270)));
} else if (property == priv->trans_key_mode_prop) {
mgr_property = true;

switch (val) {
case 0:
info->trans_enabled = false;
break;
case 1:
info->trans_enabled = true;
info->trans_key_type = OMAP_DSS_COLOR_KEY_GFX_DST;
break;
case 2:
info->trans_enabled = true;
info->trans_key_type = OMAP_DSS_COLOR_KEY_VID_SRC;
break;
}
} else if (property == priv->trans_key_prop) {
mgr_property = true;

info->trans_key = val;
} else if (property == priv->background_color_prop) {
mgr_property = true;

info->default_color = val;
} else if (property == priv->alpha_blender_prop) {
mgr_property = true;

info->partial_alpha_enabled = !!val;
}

return omap_plane_set_property(omap_crtc->plane, property, val);
if (mgr_property)
return omap_crtc_apply(crtc, &omap_crtc->mgr_apply);
else
return omap_plane_set_property(omap_crtc->plane, property, val);
}

static const struct drm_crtc_funcs omap_crtc_funcs = {
Expand Down Expand Up @@ -659,6 +693,19 @@ static void set_enabled(struct drm_crtc *crtc, bool enable)
}
}

static void omap_crtc_mgr_pre_apply(struct omap_drm_apply *apply)
{
struct omap_crtc *omap_crtc =
container_of(apply, struct omap_crtc, mgr_apply);

dispc_mgr_setup(omap_crtc->channel, &omap_crtc->info);
}

static void omap_crtc_mgr_post_apply(struct omap_drm_apply *apply)
{
/* nothing needed for post-apply */
}

static void omap_crtc_pre_apply(struct omap_drm_apply *apply)
{
struct omap_crtc *omap_crtc =
Expand Down Expand Up @@ -762,6 +809,63 @@ void omap_crtc_pre_uninit(void)
dss_uninstall_mgr_ops();
}

static void omap_crtc_install_properties(struct drm_crtc *crtc)
{
struct drm_mode_object *obj = &crtc->base;
struct drm_device *dev = crtc->dev;
struct omap_drm_private *priv = dev->dev_private;
struct drm_property *prop;

prop = priv->trans_key_mode_prop;
if (!prop) {
static const struct drm_prop_enum_list list[] = {
{ 0, "disable"},
{ 1, "gfx-dst"},
{ 2, "vid-src"},
};
prop = drm_property_create_enum(dev, 0, "trans-key-mode",
list, ARRAY_SIZE(list));
if (prop == NULL)
return;
priv->trans_key_mode_prop = prop;
}
drm_object_attach_property(obj, prop, 0);

prop = priv->trans_key_prop;
if (!prop) {
prop = drm_property_create_range(dev, 0, "trans-key",
0, 0xffffff);
if (prop == NULL)
return;
priv->trans_key_prop = prop;
}
drm_object_attach_property(obj, prop, 0);

prop = priv->background_color_prop;
if (!prop) {
prop = drm_property_create_range(dev, 0, "background",
0, 0xffffff);
if (prop == NULL)
return;
priv->background_color_prop = prop;
}
drm_object_attach_property(obj, prop, 0);

prop = priv->alpha_blender_prop;
if (!prop) {
static const struct drm_prop_enum_list list[] = {
{ 0, "disable"},
{ 1, "enable"},
};
prop = drm_property_create_enum(dev, 0, "alpha_blender",
list, ARRAY_SIZE(list));
if (prop == NULL)
return;
priv->alpha_blender_prop = prop;
}
drm_object_attach_property(obj, prop, 0);
}

/* initialize crtc */
struct drm_crtc *omap_crtc_init(struct drm_device *dev,
struct drm_plane *plane, enum omap_channel channel, int id)
Expand All @@ -787,6 +891,9 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
omap_crtc->apply.pre_apply = omap_crtc_pre_apply;
omap_crtc->apply.post_apply = omap_crtc_post_apply;

omap_crtc->mgr_apply.pre_apply = omap_crtc_mgr_pre_apply;
omap_crtc->mgr_apply.post_apply = omap_crtc_mgr_post_apply;

omap_crtc->channel = channel;
omap_crtc->plane = plane;
omap_crtc->plane->crtc = crtc;
Expand Down Expand Up @@ -814,6 +921,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
drm_crtc_init(dev, crtc, &omap_crtc_funcs);
drm_crtc_helper_add(crtc, &omap_crtc_helper_funcs);

omap_crtc_install_properties(crtc);
omap_plane_install_properties(omap_crtc->plane, &crtc->base);

omap_crtcs[channel] = omap_crtc;
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/omapdrm/omap_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ struct omap_drm_private {
struct drm_property *zorder_prop;
struct drm_property *global_alpha_prop;
struct drm_property *pre_mult_alpha_prop;
struct drm_property *trans_key_mode_prop;
struct drm_property *trans_key_prop;
struct drm_property *background_color_prop;
struct drm_property *alpha_blender_prop;

/* irq handling: */
struct list_head irq_list; /* list of omap_drm_irq */
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/omapdrm/omap_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,10 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
goto fail;
}

if (mode_cmd->width % format->planes[i].stride_bpp != 0) {
if (pitch % format->planes[i].stride_bpp != 0) {
dev_err(dev->dev,
"buffer width (%d) is not a multiple of pixel width (%d)\n",
mode_cmd->width, format->planes[i].stride_bpp);
"buffer pitch (%d bytes) is not a multiple of pixel size (%d bytes)\n",
pitch, format->planes[i].stride_bpp);
ret = -EINVAL;
goto fail;
}
Expand Down
Loading

0 comments on commit 406ea53

Please sign in to comment.