Commit c1368b34 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-fixes-2020-02-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

drm-misc-fixes for v5.6-rc3:
- Fix dt binding for sunxi.
- Allow only 1 rotation argument, and allow 0 rotation in video cmdline.
- Small compiler warning fix for panfrost.
- Fix when using performance counters in panfrost when using per fd address space.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/f5a6370d-9898-6c72-43e4-5bb56a99b6f2@linux.intel.com
parents 7c42545c dde2bb2d
...@@ -43,9 +43,13 @@ properties: ...@@ -43,9 +43,13 @@ properties:
- enum: - enum:
- allwinner,sun8i-h3-tcon-tv - allwinner,sun8i-h3-tcon-tv
- allwinner,sun50i-a64-tcon-tv - allwinner,sun50i-a64-tcon-tv
- allwinner,sun50i-h6-tcon-tv
- const: allwinner,sun8i-a83t-tcon-tv - const: allwinner,sun8i-a83t-tcon-tv
- items:
- enum:
- allwinner,sun50i-h6-tcon-tv
- const: allwinner,sun8i-r40-tcon-tv
reg: reg:
maxItems: 1 maxItems: 1
......
...@@ -297,7 +297,7 @@ static inline int tc_poll_timeout(struct tc_data *tc, unsigned int addr, ...@@ -297,7 +297,7 @@ static inline int tc_poll_timeout(struct tc_data *tc, unsigned int addr,
static int tc_aux_wait_busy(struct tc_data *tc) static int tc_aux_wait_busy(struct tc_data *tc)
{ {
return tc_poll_timeout(tc, DP0_AUXSTATUS, AUX_BUSY, 0, 1000, 100000); return tc_poll_timeout(tc, DP0_AUXSTATUS, AUX_BUSY, 0, 100, 100000);
} }
static int tc_aux_write_data(struct tc_data *tc, const void *data, static int tc_aux_write_data(struct tc_data *tc, const void *data,
...@@ -640,7 +640,7 @@ static int tc_aux_link_setup(struct tc_data *tc) ...@@ -640,7 +640,7 @@ static int tc_aux_link_setup(struct tc_data *tc)
if (ret) if (ret)
goto err; goto err;
ret = tc_poll_timeout(tc, DP_PHY_CTRL, PHY_RDY, PHY_RDY, 1, 1000); ret = tc_poll_timeout(tc, DP_PHY_CTRL, PHY_RDY, PHY_RDY, 100, 100000);
if (ret == -ETIMEDOUT) { if (ret == -ETIMEDOUT) {
dev_err(tc->dev, "Timeout waiting for PHY to become ready"); dev_err(tc->dev, "Timeout waiting for PHY to become ready");
return ret; return ret;
...@@ -876,7 +876,7 @@ static int tc_wait_link_training(struct tc_data *tc) ...@@ -876,7 +876,7 @@ static int tc_wait_link_training(struct tc_data *tc)
int ret; int ret;
ret = tc_poll_timeout(tc, DP0_LTSTAT, LT_LOOPDONE, ret = tc_poll_timeout(tc, DP0_LTSTAT, LT_LOOPDONE,
LT_LOOPDONE, 1, 1000); LT_LOOPDONE, 500, 100000);
if (ret) { if (ret) {
dev_err(tc->dev, "Link training timeout waiting for LT_LOOPDONE!\n"); dev_err(tc->dev, "Link training timeout waiting for LT_LOOPDONE!\n");
return ret; return ret;
...@@ -949,7 +949,7 @@ static int tc_main_link_enable(struct tc_data *tc) ...@@ -949,7 +949,7 @@ static int tc_main_link_enable(struct tc_data *tc)
dp_phy_ctrl &= ~(DP_PHY_RST | PHY_M1_RST | PHY_M0_RST); dp_phy_ctrl &= ~(DP_PHY_RST | PHY_M1_RST | PHY_M0_RST);
ret = regmap_write(tc->regmap, DP_PHY_CTRL, dp_phy_ctrl); ret = regmap_write(tc->regmap, DP_PHY_CTRL, dp_phy_ctrl);
ret = tc_poll_timeout(tc, DP_PHY_CTRL, PHY_RDY, PHY_RDY, 1, 1000); ret = tc_poll_timeout(tc, DP_PHY_CTRL, PHY_RDY, PHY_RDY, 500, 100000);
if (ret) { if (ret) {
dev_err(dev, "timeout waiting for phy become ready"); dev_err(dev, "timeout waiting for phy become ready");
return ret; return ret;
......
...@@ -140,7 +140,8 @@ static int tfp410_attach(struct drm_bridge *bridge) ...@@ -140,7 +140,8 @@ static int tfp410_attach(struct drm_bridge *bridge)
dvi->connector_type, dvi->connector_type,
dvi->ddc); dvi->ddc);
if (ret) { if (ret) {
dev_err(dvi->dev, "drm_connector_init() failed: %d\n", ret); dev_err(dvi->dev, "drm_connector_init_with_ddc() failed: %d\n",
ret);
return ret; return ret;
} }
......
...@@ -951,7 +951,8 @@ bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation) ...@@ -951,7 +951,8 @@ bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation)
* depending on the hardware this may require the framebuffer * depending on the hardware this may require the framebuffer
* to be in a specific tiling format. * to be in a specific tiling format.
*/ */
if ((*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_180 || if (((*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_0 &&
(*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_180) ||
!plane->rotation_property) !plane->rotation_property)
return false; return false;
......
...@@ -1698,6 +1698,13 @@ static int drm_mode_parse_cmdline_options(const char *str, ...@@ -1698,6 +1698,13 @@ static int drm_mode_parse_cmdline_options(const char *str,
if (rotation && freestanding) if (rotation && freestanding)
return -EINVAL; return -EINVAL;
if (!(rotation & DRM_MODE_ROTATE_MASK))
rotation |= DRM_MODE_ROTATE_0;
/* Make sure there is exactly one rotation defined */
if (!is_power_of_2(rotation & DRM_MODE_ROTATE_MASK))
return -EINVAL;
mode->rotation_reflection = rotation; mode->rotation_reflection = rotation;
return 0; return 0;
......
...@@ -280,12 +280,8 @@ static void panfrost_job_cleanup(struct kref *ref) ...@@ -280,12 +280,8 @@ static void panfrost_job_cleanup(struct kref *ref)
} }
if (job->bos) { if (job->bos) {
struct panfrost_gem_object *bo; for (i = 0; i < job->bo_count; i++)
for (i = 0; i < job->bo_count; i++) {
bo = to_panfrost_bo(job->bos[i]);
drm_gem_object_put_unlocked(job->bos[i]); drm_gem_object_put_unlocked(job->bos[i]);
}
kvfree(job->bos); kvfree(job->bos);
} }
......
...@@ -151,7 +151,12 @@ u32 panfrost_mmu_as_get(struct panfrost_device *pfdev, struct panfrost_mmu *mmu) ...@@ -151,7 +151,12 @@ u32 panfrost_mmu_as_get(struct panfrost_device *pfdev, struct panfrost_mmu *mmu)
as = mmu->as; as = mmu->as;
if (as >= 0) { if (as >= 0) {
int en = atomic_inc_return(&mmu->as_count); int en = atomic_inc_return(&mmu->as_count);
WARN_ON(en >= NUM_JOB_SLOTS);
/*
* AS can be retained by active jobs or a perfcnt context,
* hence the '+ 1' here.
*/
WARN_ON(en >= (NUM_JOB_SLOTS + 1));
list_move(&mmu->list, &pfdev->as_lru_list); list_move(&mmu->list, &pfdev->as_lru_list);
goto out; goto out;
......
...@@ -73,7 +73,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev, ...@@ -73,7 +73,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev,
struct panfrost_file_priv *user = file_priv->driver_priv; struct panfrost_file_priv *user = file_priv->driver_priv;
struct panfrost_perfcnt *perfcnt = pfdev->perfcnt; struct panfrost_perfcnt *perfcnt = pfdev->perfcnt;
struct drm_gem_shmem_object *bo; struct drm_gem_shmem_object *bo;
u32 cfg; u32 cfg, as;
int ret; int ret;
if (user == perfcnt->user) if (user == perfcnt->user)
...@@ -126,12 +126,8 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev, ...@@ -126,12 +126,8 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev,
perfcnt->user = user; perfcnt->user = user;
/* as = panfrost_mmu_as_get(pfdev, perfcnt->mapping->mmu);
* Always use address space 0 for now. cfg = GPU_PERFCNT_CFG_AS(as) |
* FIXME: this needs to be updated when we start using different
* address space.
*/
cfg = GPU_PERFCNT_CFG_AS(0) |
GPU_PERFCNT_CFG_MODE(GPU_PERFCNT_CFG_MODE_MANUAL); GPU_PERFCNT_CFG_MODE(GPU_PERFCNT_CFG_MODE_MANUAL);
/* /*
...@@ -195,6 +191,7 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev, ...@@ -195,6 +191,7 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev,
drm_gem_shmem_vunmap(&perfcnt->mapping->obj->base.base, perfcnt->buf); drm_gem_shmem_vunmap(&perfcnt->mapping->obj->base.base, perfcnt->buf);
perfcnt->buf = NULL; perfcnt->buf = NULL;
panfrost_gem_close(&perfcnt->mapping->obj->base.base, file_priv); panfrost_gem_close(&perfcnt->mapping->obj->base.base, file_priv);
panfrost_mmu_as_put(pfdev, perfcnt->mapping->mmu);
panfrost_gem_mapping_put(perfcnt->mapping); panfrost_gem_mapping_put(perfcnt->mapping);
perfcnt->mapping = NULL; perfcnt->mapping = NULL;
pm_runtime_mark_last_busy(pfdev->dev); pm_runtime_mark_last_busy(pfdev->dev);
......
...@@ -53,6 +53,7 @@ cmdline_test(drm_cmdline_test_rotate_0) ...@@ -53,6 +53,7 @@ cmdline_test(drm_cmdline_test_rotate_0)
cmdline_test(drm_cmdline_test_rotate_90) cmdline_test(drm_cmdline_test_rotate_90)
cmdline_test(drm_cmdline_test_rotate_180) cmdline_test(drm_cmdline_test_rotate_180)
cmdline_test(drm_cmdline_test_rotate_270) cmdline_test(drm_cmdline_test_rotate_270)
cmdline_test(drm_cmdline_test_rotate_multiple)
cmdline_test(drm_cmdline_test_rotate_invalid_val) cmdline_test(drm_cmdline_test_rotate_invalid_val)
cmdline_test(drm_cmdline_test_rotate_truncated) cmdline_test(drm_cmdline_test_rotate_truncated)
cmdline_test(drm_cmdline_test_hmirror) cmdline_test(drm_cmdline_test_hmirror)
......
...@@ -856,6 +856,17 @@ static int drm_cmdline_test_rotate_270(void *ignored) ...@@ -856,6 +856,17 @@ static int drm_cmdline_test_rotate_270(void *ignored)
return 0; return 0;
} }
static int drm_cmdline_test_rotate_multiple(void *ignored)
{
struct drm_cmdline_mode mode = { };
FAIL_ON(drm_mode_parse_command_line_for_connector("720x480,rotate=0,rotate=90",
&no_connector,
&mode));
return 0;
}
static int drm_cmdline_test_rotate_invalid_val(void *ignored) static int drm_cmdline_test_rotate_invalid_val(void *ignored)
{ {
struct drm_cmdline_mode mode = { }; struct drm_cmdline_mode mode = { };
...@@ -888,7 +899,7 @@ static int drm_cmdline_test_hmirror(void *ignored) ...@@ -888,7 +899,7 @@ static int drm_cmdline_test_hmirror(void *ignored)
FAIL_ON(!mode.specified); FAIL_ON(!mode.specified);
FAIL_ON(mode.xres != 720); FAIL_ON(mode.xres != 720);
FAIL_ON(mode.yres != 480); FAIL_ON(mode.yres != 480);
FAIL_ON(mode.rotation_reflection != DRM_MODE_REFLECT_X); FAIL_ON(mode.rotation_reflection != (DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_X));
FAIL_ON(mode.refresh_specified); FAIL_ON(mode.refresh_specified);
...@@ -913,7 +924,7 @@ static int drm_cmdline_test_vmirror(void *ignored) ...@@ -913,7 +924,7 @@ static int drm_cmdline_test_vmirror(void *ignored)
FAIL_ON(!mode.specified); FAIL_ON(!mode.specified);
FAIL_ON(mode.xres != 720); FAIL_ON(mode.xres != 720);
FAIL_ON(mode.yres != 480); FAIL_ON(mode.yres != 480);
FAIL_ON(mode.rotation_reflection != DRM_MODE_REFLECT_Y); FAIL_ON(mode.rotation_reflection != (DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_Y));
FAIL_ON(mode.refresh_specified); FAIL_ON(mode.refresh_specified);
......
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