Skip to content

Commit c1368b3

Browse files
committed
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: Dave Airlie <[email protected]> From: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 7c42545 + dde2bb2 commit c1368b3

File tree

10 files changed

+45
-22
lines changed

10 files changed

+45
-22
lines changed

Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ properties:
4343
- enum:
4444
- allwinner,sun8i-h3-tcon-tv
4545
- allwinner,sun50i-a64-tcon-tv
46-
- allwinner,sun50i-h6-tcon-tv
4746
- const: allwinner,sun8i-a83t-tcon-tv
4847

48+
- items:
49+
- enum:
50+
- allwinner,sun50i-h6-tcon-tv
51+
- const: allwinner,sun8i-r40-tcon-tv
52+
4953
reg:
5054
maxItems: 1
5155

drivers/gpu/drm/bridge/tc358767.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static inline int tc_poll_timeout(struct tc_data *tc, unsigned int addr,
297297

298298
static int tc_aux_wait_busy(struct tc_data *tc)
299299
{
300-
return tc_poll_timeout(tc, DP0_AUXSTATUS, AUX_BUSY, 0, 1000, 100000);
300+
return tc_poll_timeout(tc, DP0_AUXSTATUS, AUX_BUSY, 0, 100, 100000);
301301
}
302302

303303
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)
640640
if (ret)
641641
goto err;
642642

643-
ret = tc_poll_timeout(tc, DP_PHY_CTRL, PHY_RDY, PHY_RDY, 1, 1000);
643+
ret = tc_poll_timeout(tc, DP_PHY_CTRL, PHY_RDY, PHY_RDY, 100, 100000);
644644
if (ret == -ETIMEDOUT) {
645645
dev_err(tc->dev, "Timeout waiting for PHY to become ready");
646646
return ret;
@@ -876,7 +876,7 @@ static int tc_wait_link_training(struct tc_data *tc)
876876
int ret;
877877

878878
ret = tc_poll_timeout(tc, DP0_LTSTAT, LT_LOOPDONE,
879-
LT_LOOPDONE, 1, 1000);
879+
LT_LOOPDONE, 500, 100000);
880880
if (ret) {
881881
dev_err(tc->dev, "Link training timeout waiting for LT_LOOPDONE!\n");
882882
return ret;
@@ -949,7 +949,7 @@ static int tc_main_link_enable(struct tc_data *tc)
949949
dp_phy_ctrl &= ~(DP_PHY_RST | PHY_M1_RST | PHY_M0_RST);
950950
ret = regmap_write(tc->regmap, DP_PHY_CTRL, dp_phy_ctrl);
951951

952-
ret = tc_poll_timeout(tc, DP_PHY_CTRL, PHY_RDY, PHY_RDY, 1, 1000);
952+
ret = tc_poll_timeout(tc, DP_PHY_CTRL, PHY_RDY, PHY_RDY, 500, 100000);
953953
if (ret) {
954954
dev_err(dev, "timeout waiting for phy become ready");
955955
return ret;

drivers/gpu/drm/bridge/ti-tfp410.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ static int tfp410_attach(struct drm_bridge *bridge)
140140
dvi->connector_type,
141141
dvi->ddc);
142142
if (ret) {
143-
dev_err(dvi->dev, "drm_connector_init() failed: %d\n", ret);
143+
dev_err(dvi->dev, "drm_connector_init_with_ddc() failed: %d\n",
144+
ret);
144145
return ret;
145146
}
146147

drivers/gpu/drm/drm_client_modeset.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,8 @@ bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation)
951951
* depending on the hardware this may require the framebuffer
952952
* to be in a specific tiling format.
953953
*/
954-
if ((*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_180 ||
954+
if (((*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_0 &&
955+
(*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_180) ||
955956
!plane->rotation_property)
956957
return false;
957958

drivers/gpu/drm/drm_modes.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,6 +1698,13 @@ static int drm_mode_parse_cmdline_options(const char *str,
16981698
if (rotation && freestanding)
16991699
return -EINVAL;
17001700

1701+
if (!(rotation & DRM_MODE_ROTATE_MASK))
1702+
rotation |= DRM_MODE_ROTATE_0;
1703+
1704+
/* Make sure there is exactly one rotation defined */
1705+
if (!is_power_of_2(rotation & DRM_MODE_ROTATE_MASK))
1706+
return -EINVAL;
1707+
17011708
mode->rotation_reflection = rotation;
17021709

17031710
return 0;

drivers/gpu/drm/panfrost/panfrost_job.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,8 @@ static void panfrost_job_cleanup(struct kref *ref)
280280
}
281281

282282
if (job->bos) {
283-
struct panfrost_gem_object *bo;
284-
285-
for (i = 0; i < job->bo_count; i++) {
286-
bo = to_panfrost_bo(job->bos[i]);
283+
for (i = 0; i < job->bo_count; i++)
287284
drm_gem_object_put_unlocked(job->bos[i]);
288-
}
289285

290286
kvfree(job->bos);
291287
}

drivers/gpu/drm/panfrost/panfrost_mmu.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,12 @@ u32 panfrost_mmu_as_get(struct panfrost_device *pfdev, struct panfrost_mmu *mmu)
151151
as = mmu->as;
152152
if (as >= 0) {
153153
int en = atomic_inc_return(&mmu->as_count);
154-
WARN_ON(en >= NUM_JOB_SLOTS);
154+
155+
/*
156+
* AS can be retained by active jobs or a perfcnt context,
157+
* hence the '+ 1' here.
158+
*/
159+
WARN_ON(en >= (NUM_JOB_SLOTS + 1));
155160

156161
list_move(&mmu->list, &pfdev->as_lru_list);
157162
goto out;

drivers/gpu/drm/panfrost/panfrost_perfcnt.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev,
7373
struct panfrost_file_priv *user = file_priv->driver_priv;
7474
struct panfrost_perfcnt *perfcnt = pfdev->perfcnt;
7575
struct drm_gem_shmem_object *bo;
76-
u32 cfg;
76+
u32 cfg, as;
7777
int ret;
7878

7979
if (user == perfcnt->user)
@@ -126,12 +126,8 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev,
126126

127127
perfcnt->user = user;
128128

129-
/*
130-
* Always use address space 0 for now.
131-
* FIXME: this needs to be updated when we start using different
132-
* address space.
133-
*/
134-
cfg = GPU_PERFCNT_CFG_AS(0) |
129+
as = panfrost_mmu_as_get(pfdev, perfcnt->mapping->mmu);
130+
cfg = GPU_PERFCNT_CFG_AS(as) |
135131
GPU_PERFCNT_CFG_MODE(GPU_PERFCNT_CFG_MODE_MANUAL);
136132

137133
/*
@@ -195,6 +191,7 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev,
195191
drm_gem_shmem_vunmap(&perfcnt->mapping->obj->base.base, perfcnt->buf);
196192
perfcnt->buf = NULL;
197193
panfrost_gem_close(&perfcnt->mapping->obj->base.base, file_priv);
194+
panfrost_mmu_as_put(pfdev, perfcnt->mapping->mmu);
198195
panfrost_gem_mapping_put(perfcnt->mapping);
199196
perfcnt->mapping = NULL;
200197
pm_runtime_mark_last_busy(pfdev->dev);

drivers/gpu/drm/selftests/drm_cmdline_selftests.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ cmdline_test(drm_cmdline_test_rotate_0)
5353
cmdline_test(drm_cmdline_test_rotate_90)
5454
cmdline_test(drm_cmdline_test_rotate_180)
5555
cmdline_test(drm_cmdline_test_rotate_270)
56+
cmdline_test(drm_cmdline_test_rotate_multiple)
5657
cmdline_test(drm_cmdline_test_rotate_invalid_val)
5758
cmdline_test(drm_cmdline_test_rotate_truncated)
5859
cmdline_test(drm_cmdline_test_hmirror)

drivers/gpu/drm/selftests/test-drm_cmdline_parser.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,17 @@ static int drm_cmdline_test_rotate_270(void *ignored)
856856
return 0;
857857
}
858858

859+
static int drm_cmdline_test_rotate_multiple(void *ignored)
860+
{
861+
struct drm_cmdline_mode mode = { };
862+
863+
FAIL_ON(drm_mode_parse_command_line_for_connector("720x480,rotate=0,rotate=90",
864+
&no_connector,
865+
&mode));
866+
867+
return 0;
868+
}
869+
859870
static int drm_cmdline_test_rotate_invalid_val(void *ignored)
860871
{
861872
struct drm_cmdline_mode mode = { };
@@ -888,7 +899,7 @@ static int drm_cmdline_test_hmirror(void *ignored)
888899
FAIL_ON(!mode.specified);
889900
FAIL_ON(mode.xres != 720);
890901
FAIL_ON(mode.yres != 480);
891-
FAIL_ON(mode.rotation_reflection != DRM_MODE_REFLECT_X);
902+
FAIL_ON(mode.rotation_reflection != (DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_X));
892903

893904
FAIL_ON(mode.refresh_specified);
894905

@@ -913,7 +924,7 @@ static int drm_cmdline_test_vmirror(void *ignored)
913924
FAIL_ON(!mode.specified);
914925
FAIL_ON(mode.xres != 720);
915926
FAIL_ON(mode.yres != 480);
916-
FAIL_ON(mode.rotation_reflection != DRM_MODE_REFLECT_Y);
927+
FAIL_ON(mode.rotation_reflection != (DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_Y));
917928

918929
FAIL_ON(mode.refresh_specified);
919930

0 commit comments

Comments
 (0)