Skip to content

Commit 640eee0

Browse files
committed
Merge tag 'drm-misc-next-fixes-2020-10-13' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
One fix for a bad revert in ingenic-drm, and one fix for panfrost to increase a timeout at power up. Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 0d2e90f + d3c8f27 commit 640eee0

File tree

5 files changed

+10
-131
lines changed

5 files changed

+10
-131
lines changed

MAINTAINERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5594,12 +5594,13 @@ S: Maintained
55945594
F: Documentation/devicetree/bindings/display/panel/raydium,rm67191.yaml
55955595
F: drivers/gpu/drm/panel/panel-raydium-rm67191.c
55965596

5597-
DRM DRIVER FOR ROCKTECH JH057N00900 PANELS
5597+
DRM DRIVER FOR SITRONIX ST7703 PANELS
55985598
M: Guido Günther <[email protected]>
55995599
R: Purism Kernel Team <[email protected]>
5600+
R: Ondrej Jirman <[email protected]>
56005601
S: Maintained
5601-
F: Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.txt
5602-
F: drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
5602+
F: Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
5603+
F: drivers/gpu/drm/panel/panel-sitronix-st7703.c
56035604

56045605
DRM DRIVER FOR SAVAGE VIDEO CARDS
56055606
S: Orphan / Obsolete

drivers/gpu/drm/ingenic/ingenic-drm-drv.c

Lines changed: 2 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include <linux/component.h>
1010
#include <linux/clk.h>
1111
#include <linux/dma-mapping.h>
12-
#include <linux/dma-noncoherent.h>
13-
#include <linux/io.h>
1412
#include <linux/module.h>
1513
#include <linux/of_device.h>
1614
#include <linux/platform_device.h>
@@ -21,7 +19,6 @@
2119
#include <drm/drm_bridge.h>
2220
#include <drm/drm_crtc.h>
2321
#include <drm/drm_crtc_helper.h>
24-
#include <drm/drm_damage_helper.h>
2522
#include <drm/drm_drv.h>
2623
#include <drm/drm_gem_cma_helper.h>
2724
#include <drm/drm_fb_cma_helper.h>
@@ -79,11 +76,6 @@ static const u32 ingenic_drm_primary_formats[] = {
7976
DRM_FORMAT_XRGB8888,
8077
};
8178

82-
static bool ingenic_drm_cached_gem_buf;
83-
module_param_named(cached_gem_buffers, ingenic_drm_cached_gem_buf, bool, 0400);
84-
MODULE_PARM_DESC(cached_gem_buffers,
85-
"Enable fully cached GEM buffers [default=false]");
86-
8779
static bool ingenic_drm_writeable_reg(struct device *dev, unsigned int reg)
8880
{
8981
switch (reg) {
@@ -346,8 +338,6 @@ static int ingenic_drm_plane_atomic_check(struct drm_plane *plane,
346338
plane->state->fb->format->format != state->fb->format->format))
347339
crtc_state->mode_changed = true;
348340

349-
drm_atomic_helper_check_plane_damage(state->state, state);
350-
351341
return 0;
352342
}
353343

@@ -450,38 +440,6 @@ void ingenic_drm_plane_config(struct device *dev,
450440
}
451441
}
452442

453-
void ingenic_drm_sync_data(struct device *dev,
454-
struct drm_plane_state *old_state,
455-
struct drm_plane_state *state)
456-
{
457-
const struct drm_format_info *finfo = state->fb->format;
458-
struct ingenic_drm *priv = dev_get_drvdata(dev);
459-
struct drm_atomic_helper_damage_iter iter;
460-
unsigned int offset, i;
461-
struct drm_rect clip;
462-
dma_addr_t paddr;
463-
void *addr;
464-
465-
if (!ingenic_drm_cached_gem_buf)
466-
return;
467-
468-
drm_atomic_helper_damage_iter_init(&iter, old_state, state);
469-
470-
drm_atomic_for_each_plane_damage(&iter, &clip) {
471-
for (i = 0; i < finfo->num_planes; i++) {
472-
paddr = drm_fb_cma_get_gem_addr(state->fb, state, i);
473-
addr = phys_to_virt(paddr);
474-
475-
/* Ignore x1/x2 values, invalidate complete lines */
476-
offset = clip.y1 * state->fb->pitches[i];
477-
478-
dma_cache_sync(priv->dev, addr + offset,
479-
(clip.y2 - clip.y1) * state->fb->pitches[i],
480-
DMA_TO_DEVICE);
481-
}
482-
}
483-
}
484-
485443
static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
486444
struct drm_plane_state *oldstate)
487445
{
@@ -492,8 +450,6 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
492450
dma_addr_t addr;
493451

494452
if (state && state->fb) {
495-
ingenic_drm_sync_data(priv->dev, oldstate, state);
496-
497453
addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
498454
width = state->src_w >> 16;
499455
height = state->src_h >> 16;
@@ -649,69 +605,7 @@ static void ingenic_drm_disable_vblank(struct drm_crtc *crtc)
649605
regmap_update_bits(priv->map, JZ_REG_LCD_CTRL, JZ_LCD_CTRL_EOF_IRQ, 0);
650606
}
651607

652-
static struct drm_framebuffer *
653-
ingenic_drm_gem_fb_create(struct drm_device *dev, struct drm_file *file,
654-
const struct drm_mode_fb_cmd2 *mode_cmd)
655-
{
656-
if (ingenic_drm_cached_gem_buf)
657-
return drm_gem_fb_create_with_dirty(dev, file, mode_cmd);
658-
659-
return drm_gem_fb_create(dev, file, mode_cmd);
660-
}
661-
662-
static int ingenic_drm_gem_mmap(struct drm_gem_object *obj,
663-
struct vm_area_struct *vma)
664-
{
665-
struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(obj);
666-
struct device *dev = cma_obj->base.dev->dev;
667-
unsigned long attrs;
668-
int ret;
669-
670-
if (ingenic_drm_cached_gem_buf)
671-
attrs = DMA_ATTR_NON_CONSISTENT;
672-
else
673-
attrs = DMA_ATTR_WRITE_COMBINE;
674-
675-
/*
676-
* Clear the VM_PFNMAP flag that was set by drm_gem_mmap(), and set the
677-
* vm_pgoff (used as a fake buffer offset by DRM) to 0 as we want to map
678-
* the whole buffer.
679-
*/
680-
vma->vm_flags &= ~VM_PFNMAP;
681-
vma->vm_pgoff = 0;
682-
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
683-
684-
ret = dma_mmap_attrs(dev, vma, cma_obj->vaddr, cma_obj->paddr,
685-
vma->vm_end - vma->vm_start, attrs);
686-
if (ret)
687-
drm_gem_vm_close(vma);
688-
689-
return ret;
690-
}
691-
692-
static int ingenic_drm_gem_cma_mmap(struct file *filp,
693-
struct vm_area_struct *vma)
694-
{
695-
int ret;
696-
697-
ret = drm_gem_mmap(filp, vma);
698-
if (ret)
699-
return ret;
700-
701-
return ingenic_drm_gem_mmap(vma->vm_private_data, vma);
702-
}
703-
704-
static const struct file_operations ingenic_drm_fops = {
705-
.owner = THIS_MODULE,
706-
.open = drm_open,
707-
.release = drm_release,
708-
.unlocked_ioctl = drm_ioctl,
709-
.compat_ioctl = drm_compat_ioctl,
710-
.poll = drm_poll,
711-
.read = drm_read,
712-
.llseek = noop_llseek,
713-
.mmap = ingenic_drm_gem_cma_mmap,
714-
};
608+
DEFINE_DRM_GEM_CMA_FOPS(ingenic_drm_fops);
715609

716610
static struct drm_driver ingenic_drm_driver_data = {
717611
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
@@ -775,7 +669,7 @@ static const struct drm_encoder_helper_funcs ingenic_drm_encoder_helper_funcs =
775669
};
776670

777671
static const struct drm_mode_config_funcs ingenic_drm_mode_config_funcs = {
778-
.fb_create = ingenic_drm_gem_fb_create,
672+
.fb_create = drm_gem_fb_create,
779673
.output_poll_changed = drm_fb_helper_output_poll_changed,
780674
.atomic_check = drm_atomic_helper_check,
781675
.atomic_commit = drm_atomic_helper_commit,
@@ -902,8 +796,6 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
902796
return ret;
903797
}
904798

905-
drm_plane_enable_fb_damage_clips(&priv->f1);
906-
907799
drm_crtc_helper_add(&priv->crtc, &ingenic_drm_crtc_helper_funcs);
908800

909801
ret = drm_crtc_init_with_planes(drm, &priv->crtc, &priv->f1,
@@ -929,8 +821,6 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
929821
return ret;
930822
}
931823

932-
drm_plane_enable_fb_damage_clips(&priv->f0);
933-
934824
if (IS_ENABLED(CONFIG_DRM_INGENIC_IPU) && has_components) {
935825
ret = component_bind_all(dev, drm);
936826
if (ret) {

drivers/gpu/drm/ingenic/ingenic-drm.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@ void ingenic_drm_plane_config(struct device *dev,
168168
struct drm_plane *plane, u32 fourcc);
169169
void ingenic_drm_plane_disable(struct device *dev, struct drm_plane *plane);
170170

171-
void ingenic_drm_sync_data(struct device *dev,
172-
struct drm_plane_state *old_state,
173-
struct drm_plane_state *state);
174-
175171
extern struct platform_driver *ingenic_ipu_driver_ptr;
176172

177173
#endif /* DRIVERS_GPU_DRM_INGENIC_INGENIC_DRM_H */

drivers/gpu/drm/ingenic/ingenic-ipu.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include <drm/drm_atomic.h>
2222
#include <drm/drm_atomic_helper.h>
23-
#include <drm/drm_damage_helper.h>
2423
#include <drm/drm_drv.h>
2524
#include <drm/drm_fb_cma_helper.h>
2625
#include <drm/drm_fourcc.h>
@@ -317,8 +316,6 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane,
317316
JZ_IPU_CTRL_CHIP_EN | JZ_IPU_CTRL_LCDC_SEL);
318317
}
319318

320-
ingenic_drm_sync_data(ipu->master, oldstate, state);
321-
322319
/* New addresses will be committed in vblank handler... */
323320
ipu->addr_y = drm_fb_cma_get_gem_addr(state->fb, state, 0);
324321
if (finfo->num_planes > 1)
@@ -537,7 +534,7 @@ static int ingenic_ipu_plane_atomic_check(struct drm_plane *plane,
537534

538535
if (!state->crtc ||
539536
!crtc_state->mode.hdisplay || !crtc_state->mode.vdisplay)
540-
goto out_check_damage;
537+
return 0;
541538

542539
/* Plane must be fully visible */
543540
if (state->crtc_x < 0 || state->crtc_y < 0 ||
@@ -554,7 +551,7 @@ static int ingenic_ipu_plane_atomic_check(struct drm_plane *plane,
554551
return -EINVAL;
555552

556553
if (!osd_changed(state, plane->state))
557-
goto out_check_damage;
554+
return 0;
558555

559556
crtc_state->mode_changed = true;
560557

@@ -581,9 +578,6 @@ static int ingenic_ipu_plane_atomic_check(struct drm_plane *plane,
581578
ipu->denom_w = denom_w;
582579
ipu->denom_h = denom_h;
583580

584-
out_check_damage:
585-
drm_atomic_helper_check_plane_damage(state->state, state);
586-
587581
return 0;
588582
}
589583

@@ -765,8 +759,6 @@ static int ingenic_ipu_bind(struct device *dev, struct device *master, void *d)
765759
return err;
766760
}
767761

768-
drm_plane_enable_fb_damage_clips(plane);
769-
770762
/*
771763
* Sharpness settings range is [0,32]
772764
* 0 : nearest-neighbor

drivers/gpu/drm/panfrost/panfrost_gpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@ void panfrost_gpu_power_on(struct panfrost_device *pfdev)
325325
/* Just turn on everything for now */
326326
gpu_write(pfdev, L2_PWRON_LO, pfdev->features.l2_present);
327327
ret = readl_relaxed_poll_timeout(pfdev->iomem + L2_READY_LO,
328-
val, val == pfdev->features.l2_present, 100, 1000);
328+
val, val == pfdev->features.l2_present, 100, 20000);
329329
if (ret)
330330
dev_err(pfdev->dev, "error powering up gpu L2");
331331

332332
gpu_write(pfdev, SHADER_PWRON_LO, pfdev->features.shader_present);
333333
ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_READY_LO,
334-
val, val == pfdev->features.shader_present, 100, 1000);
334+
val, val == pfdev->features.shader_present, 100, 20000);
335335
if (ret)
336336
dev_err(pfdev->dev, "error powering up gpu shader");
337337

0 commit comments

Comments
 (0)