omapdrm fixes for v4.10

* fix tpd12s015's error handling, which causes omap5 uevm HDMI to fail
 * fix omapdrm primary plane allocation bug, which makes the display to fail to
   come up
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJYSUyuAAoJEPo9qoy8lh71VfQP/iMwdMSMDT+6C7GymR3nKfE1
 yXmR/X4KXNNpeL6AjUqFbY/WW99iOvB4B6OM2cpY5l1YrgAxLGyjgwUdAewJ2EaP
 S0itQAExHryBRuqC+m7L9MukyY1ZnWYt2EpHEKlWm/ecfpi+ZVkcQnBQmQgW6FcP
 9+1mcjtkNEcnRhHRaC+cOiEuJ94vvY+b49IzY3vovTDuR5f7JY65S/5D10XVwXRk
 WbXM/fLrnaeHX3Gm0KBhxNMWnjr190O0GfuD5mhIDZwBmmqqGD1uYrPwTc5jlIry
 KIHMLg5C1N/DeGyCTAIUUJJOVE0+6fHcFKIyoVY+3L/tx9MVDb1XoVLIjYmdBijw
 RauvF3RhIhJXhhkpTlARnob2qyOWxJAp0FsQozdyG5w2jSl+a/dJKPW88QNpopAp
 mmbA/BbyjP6n+Ze/cH4ze6ZvI1TrhTqu29JU9QiyUSHqtX/XV857EsX3ar45I39t
 b4diYhdPwJ/gWpacqI0uocdYlE6pSzmLgauymmAe7JavVGU56VkPxooCgvdcTLM5
 Ujy1/vQ7B4z87EMCORRLv/ml8LmSA42SIiVcoSqtTL78j7klxjC5aP5AiDHVlji1
 UCIkIU+czxvbG17j+lMXzXntq2inwHFCw3GTrz1HjfHF7WM7tYc4MAMfHxpP8HO1
 jF3PADc4d31PKEecV8A7
 =fhmU
 -----END PGP SIGNATURE-----

Merge tag 'omapdrm-4.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next

omapdrm fixes for v4.10

* fix tpd12s015's error handling, which causes omap5 uevm HDMI to fail
* fix omapdrm primary plane allocation bug, which makes the display to fail to
  come up

* tag 'omapdrm-4.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
  drm/omap: tpd12s015: fix error handling
  drm/omap: fix primary-plane's possible_crtcs
  drm: fix possible_crtc's type
This commit is contained in:
Dave Airlie 2016-12-09 12:27:54 +10:00
commit 6f21890989
6 changed files with 30 additions and 17 deletions

View File

@ -79,7 +79,7 @@ static unsigned int drm_num_planes(struct drm_device *dev)
* Zero on success, error code on failure. * Zero on success, error code on failure.
*/ */
int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane,
unsigned long possible_crtcs, uint32_t possible_crtcs,
const struct drm_plane_funcs *funcs, const struct drm_plane_funcs *funcs,
const uint32_t *formats, unsigned int format_count, const uint32_t *formats, unsigned int format_count,
enum drm_plane_type type, enum drm_plane_type type,
@ -196,7 +196,7 @@ void drm_plane_unregister_all(struct drm_device *dev)
* Zero on success, error code on failure. * Zero on success, error code on failure.
*/ */
int drm_plane_init(struct drm_device *dev, struct drm_plane *plane, int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
unsigned long possible_crtcs, uint32_t possible_crtcs,
const struct drm_plane_funcs *funcs, const struct drm_plane_funcs *funcs,
const uint32_t *formats, unsigned int format_count, const uint32_t *formats, unsigned int format_count,
bool is_primary) bool is_primary)

View File

@ -234,25 +234,30 @@ static int tpd_probe(struct platform_device *pdev)
if (r) if (r)
return r; return r;
gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 0, gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 0,
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(gpio)) if (IS_ERR(gpio)) {
r = PTR_ERR(gpio);
goto err_gpio; goto err_gpio;
}
ddata->ct_cp_hpd_gpio = gpio; ddata->ct_cp_hpd_gpio = gpio;
gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 1, gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 1,
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(gpio)) if (IS_ERR(gpio)) {
r = PTR_ERR(gpio);
goto err_gpio; goto err_gpio;
}
ddata->ls_oe_gpio = gpio; ddata->ls_oe_gpio = gpio;
gpio = devm_gpiod_get_index(&pdev->dev, NULL, 2, gpio = devm_gpiod_get_index(&pdev->dev, NULL, 2,
GPIOD_IN); GPIOD_IN);
if (IS_ERR(gpio)) if (IS_ERR(gpio)) {
r = PTR_ERR(gpio);
goto err_gpio; goto err_gpio;
}
ddata->hpd_gpio = gpio; ddata->hpd_gpio = gpio;

View File

@ -267,13 +267,15 @@ static int omap_connect_dssdevs(void)
} }
static int omap_modeset_create_crtc(struct drm_device *dev, int id, static int omap_modeset_create_crtc(struct drm_device *dev, int id,
enum omap_channel channel) enum omap_channel channel,
u32 possible_crtcs)
{ {
struct omap_drm_private *priv = dev->dev_private; struct omap_drm_private *priv = dev->dev_private;
struct drm_plane *plane; struct drm_plane *plane;
struct drm_crtc *crtc; struct drm_crtc *crtc;
plane = omap_plane_init(dev, id, DRM_PLANE_TYPE_PRIMARY); plane = omap_plane_init(dev, id, DRM_PLANE_TYPE_PRIMARY,
possible_crtcs);
if (IS_ERR(plane)) if (IS_ERR(plane))
return PTR_ERR(plane); return PTR_ERR(plane);
@ -309,6 +311,7 @@ static int omap_modeset_init(struct drm_device *dev)
int num_crtcs; int num_crtcs;
int i, id = 0; int i, id = 0;
int ret; int ret;
u32 possible_crtcs;
drm_mode_config_init(dev); drm_mode_config_init(dev);
@ -325,6 +328,7 @@ static int omap_modeset_init(struct drm_device *dev)
* We use the num_crtc argument to limit the number of crtcs we create. * We use the num_crtc argument to limit the number of crtcs we create.
*/ */
num_crtcs = min3(num_crtc, num_mgrs, num_ovls); num_crtcs = min3(num_crtc, num_mgrs, num_ovls);
possible_crtcs = (1 << num_crtcs) - 1;
dssdev = NULL; dssdev = NULL;
@ -388,7 +392,8 @@ static int omap_modeset_init(struct drm_device *dev)
* allocated crtc, we create a new crtc for it * allocated crtc, we create a new crtc for it
*/ */
if (!channel_used(dev, channel)) { if (!channel_used(dev, channel)) {
ret = omap_modeset_create_crtc(dev, id, channel); ret = omap_modeset_create_crtc(dev, id, channel,
possible_crtcs);
if (ret < 0) { if (ret < 0) {
dev_err(dev->dev, dev_err(dev->dev,
"could not create CRTC (channel %u)\n", "could not create CRTC (channel %u)\n",
@ -418,7 +423,8 @@ static int omap_modeset_init(struct drm_device *dev)
return -ENOMEM; return -ENOMEM;
} }
ret = omap_modeset_create_crtc(dev, id, i); ret = omap_modeset_create_crtc(dev, id, i,
possible_crtcs);
if (ret < 0) { if (ret < 0) {
dev_err(dev->dev, dev_err(dev->dev,
"could not create CRTC (channel %u)\n", i); "could not create CRTC (channel %u)\n", i);
@ -432,7 +438,8 @@ static int omap_modeset_init(struct drm_device *dev)
for (; id < num_ovls; id++) { for (; id < num_ovls; id++) {
struct drm_plane *plane; struct drm_plane *plane;
plane = omap_plane_init(dev, id, DRM_PLANE_TYPE_OVERLAY); plane = omap_plane_init(dev, id, DRM_PLANE_TYPE_OVERLAY,
possible_crtcs);
if (IS_ERR(plane)) if (IS_ERR(plane))
return PTR_ERR(plane); return PTR_ERR(plane);

View File

@ -157,7 +157,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
int omap_crtc_wait_pending(struct drm_crtc *crtc); int omap_crtc_wait_pending(struct drm_crtc *crtc);
struct drm_plane *omap_plane_init(struct drm_device *dev, struct drm_plane *omap_plane_init(struct drm_device *dev,
int id, enum drm_plane_type type); int id, enum drm_plane_type type,
u32 possible_crtcs);
void omap_plane_install_properties(struct drm_plane *plane, void omap_plane_install_properties(struct drm_plane *plane,
struct drm_mode_object *obj); struct drm_mode_object *obj);

View File

@ -356,9 +356,9 @@ static const uint32_t error_irqs[] = {
/* initialize plane */ /* initialize plane */
struct drm_plane *omap_plane_init(struct drm_device *dev, struct drm_plane *omap_plane_init(struct drm_device *dev,
int id, enum drm_plane_type type) int id, enum drm_plane_type type,
u32 possible_crtcs)
{ {
struct omap_drm_private *priv = dev->dev_private;
struct drm_plane *plane; struct drm_plane *plane;
struct omap_plane *omap_plane; struct omap_plane *omap_plane;
int ret; int ret;
@ -381,7 +381,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
omap_plane->error_irq.irq = omap_plane_error_irq; omap_plane->error_irq.irq = omap_plane_error_irq;
omap_irq_register(dev, &omap_plane->error_irq); omap_irq_register(dev, &omap_plane->error_irq);
ret = drm_universal_plane_init(dev, plane, (1 << priv->num_crtcs) - 1, ret = drm_universal_plane_init(dev, plane, possible_crtcs,
&omap_plane_funcs, omap_plane->formats, &omap_plane_funcs, omap_plane->formats,
omap_plane->nformats, type, NULL); omap_plane->nformats, type, NULL);
if (ret < 0) if (ret < 0)

View File

@ -513,7 +513,7 @@ struct drm_plane {
extern __printf(8, 9) extern __printf(8, 9)
int drm_universal_plane_init(struct drm_device *dev, int drm_universal_plane_init(struct drm_device *dev,
struct drm_plane *plane, struct drm_plane *plane,
unsigned long possible_crtcs, uint32_t possible_crtcs,
const struct drm_plane_funcs *funcs, const struct drm_plane_funcs *funcs,
const uint32_t *formats, const uint32_t *formats,
unsigned int format_count, unsigned int format_count,
@ -521,7 +521,7 @@ int drm_universal_plane_init(struct drm_device *dev,
const char *name, ...); const char *name, ...);
extern int drm_plane_init(struct drm_device *dev, extern int drm_plane_init(struct drm_device *dev,
struct drm_plane *plane, struct drm_plane *plane,
unsigned long possible_crtcs, uint32_t possible_crtcs,
const struct drm_plane_funcs *funcs, const struct drm_plane_funcs *funcs,
const uint32_t *formats, unsigned int format_count, const uint32_t *formats, unsigned int format_count,
bool is_primary); bool is_primary);