diff options
Diffstat (limited to 'recipes-kernel')
4 files changed, 2 insertions, 254 deletions
diff --git a/recipes-kernel/linux/linux-ti-staging-3.14/sgx/0001-HACK-drm-fb_helper-enable-panning-support.patch b/recipes-kernel/linux/linux-ti-staging-3.14/sgx/0001-HACK-drm-fb_helper-enable-panning-support.patch deleted file mode 100644 index e760248f..00000000 --- a/recipes-kernel/linux/linux-ti-staging-3.14/sgx/0001-HACK-drm-fb_helper-enable-panning-support.patch +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | From d9d8fea4c60b3a44e8660408eb9337413b108b15 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Darren Etheridge <detheridge@ti.com> | ||
| 3 | Date: Thu, 24 Jul 2014 11:49:28 -0500 | ||
| 4 | Subject: [PATCH 1/6] HACK: drm/fb_helper: enable panning support | ||
| 5 | |||
| 6 | Increase the size of the buffer that is created in the fbdev emulation | ||
| 7 | helpers. And fill in the var structure with the amount that was allocated. | ||
| 8 | |||
| 9 | Signed-off-by: Darren Etheridge <detheridge@ti.com> | ||
| 10 | --- | ||
| 11 | drivers/gpu/drm/drm_fb_cma_helper.c | 10 ++++++++-- | ||
| 12 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c | ||
| 15 | index 61b5a47..2e2c489 100644 | ||
| 16 | --- a/drivers/gpu/drm/drm_fb_cma_helper.c | ||
| 17 | +++ b/drivers/gpu/drm/drm_fb_cma_helper.c | ||
| 18 | @@ -25,6 +25,12 @@ | ||
| 19 | #include <drm/drm_fb_cma_helper.h> | ||
| 20 | #include <linux/module.h> | ||
| 21 | |||
| 22 | +/* | ||
| 23 | + * number of buffers to allocate from CMA pool, often increased for | ||
| 24 | + * double/triple buffering | ||
| 25 | + */ | ||
| 26 | +#define DRM_NUM_FBDEV_BUFFERS 3 | ||
| 27 | + | ||
| 28 | struct drm_fb_cma { | ||
| 29 | struct drm_framebuffer fb; | ||
| 30 | struct drm_gem_cma_object *obj[4]; | ||
| 31 | @@ -265,7 +271,7 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper, | ||
| 32 | bytes_per_pixel = DIV_ROUND_UP(sizes->surface_bpp, 8); | ||
| 33 | |||
| 34 | mode_cmd.width = sizes->surface_width; | ||
| 35 | - mode_cmd.height = sizes->surface_height; | ||
| 36 | + mode_cmd.height = sizes->surface_height * DRM_NUM_FBDEV_BUFFERS; | ||
| 37 | mode_cmd.pitches[0] = sizes->surface_width * bytes_per_pixel; | ||
| 38 | mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, | ||
| 39 | sizes->surface_depth); | ||
| 40 | @@ -304,7 +310,7 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper, | ||
| 41 | } | ||
| 42 | |||
| 43 | drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth); | ||
| 44 | - drm_fb_helper_fill_var(fbi, helper, fb->width, fb->height); | ||
| 45 | + drm_fb_helper_fill_var(fbi, helper, fb->width, sizes->surface_height); | ||
| 46 | |||
| 47 | offset = fbi->var.xoffset * bytes_per_pixel; | ||
| 48 | offset += fbi->var.yoffset * fb->pitches[0]; | ||
| 49 | -- | ||
| 50 | 1.9.1 | ||
| 51 | |||
diff --git a/recipes-kernel/linux/linux-ti-staging-3.14/sgx/0002-HACK-drm-tilcdc-add-vsync-callback-for-use-in-omaplf.patch b/recipes-kernel/linux/linux-ti-staging-3.14/sgx/0002-HACK-drm-tilcdc-add-vsync-callback-for-use-in-omaplf.patch deleted file mode 100644 index d1545086..00000000 --- a/recipes-kernel/linux/linux-ti-staging-3.14/sgx/0002-HACK-drm-tilcdc-add-vsync-callback-for-use-in-omaplf.patch +++ /dev/null | |||
| @@ -1,96 +0,0 @@ | |||
| 1 | From eaf6ac95a81612250d6bd5e2ed9da41e52aac444 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Darren Etheridge <detheridge@ti.com> | ||
| 3 | Date: Fri, 11 Jul 2014 09:15:25 -0500 | ||
| 4 | Subject: [PATCH 2/6] HACK: drm/tilcdc: add vsync callback for use in omaplfb | ||
| 5 | for gpu | ||
| 6 | |||
| 7 | Add a vsync callback registration API that is identical to what was done | ||
| 8 | for da8xx-fb.c. | ||
| 9 | |||
| 10 | Need to find if there is a better way using the DRM infrastructure from | ||
| 11 | kernel space. Either that or change the userspace window manager stuff in | ||
| 12 | the gpu libraries to make use of the DRM provided syncronization | ||
| 13 | mechanisms. | ||
| 14 | |||
| 15 | Signed-off-by: Darren Etheridge <detheridge@ti.com> | ||
| 16 | --- | ||
| 17 | drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 34 ++++++++++++++++++++++++++++++++++ | ||
| 18 | drivers/gpu/drm/tilcdc/tilcdc_drv.h | 5 +++++ | ||
| 19 | 2 files changed, 39 insertions(+) | ||
| 20 | |||
| 21 | diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | ||
| 22 | index 4b6b139..bf94a0f 100644 | ||
| 23 | --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | ||
| 24 | +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | ||
| 25 | @@ -37,6 +37,10 @@ struct tilcdc_crtc { | ||
| 26 | /* for deferred fb unref's: */ | ||
| 27 | struct drm_flip_work unref_work; | ||
| 28 | }; | ||
| 29 | + | ||
| 30 | +static vsync_callback_t vsync_cb_handler; | ||
| 31 | +static void *vsync_cb_arg; | ||
| 32 | + | ||
| 33 | #define to_tilcdc_crtc(x) container_of(x, struct tilcdc_crtc, base) | ||
| 34 | |||
| 35 | static void unref_worker(struct drm_flip_work *work, void *val) | ||
| 36 | @@ -576,6 +580,32 @@ out: | ||
| 37 | pm_runtime_put_sync(dev->dev); | ||
| 38 | } | ||
| 39 | |||
| 40 | +int register_vsync_cb(vsync_callback_t handler, void *arg, int idx) | ||
| 41 | +{ | ||
| 42 | + if ((vsync_cb_handler == NULL) && (vsync_cb_arg == NULL)) { | ||
| 43 | + vsync_cb_arg = arg; | ||
| 44 | + vsync_cb_handler = handler; | ||
| 45 | + } else { | ||
| 46 | + return -EEXIST; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + return 0; | ||
| 50 | +} | ||
| 51 | +EXPORT_SYMBOL(register_vsync_cb); | ||
| 52 | + | ||
| 53 | +int unregister_vsync_cb(vsync_callback_t handler, void *arg, int idx) | ||
| 54 | +{ | ||
| 55 | + if ((vsync_cb_handler == handler) && (vsync_cb_arg == arg)) { | ||
| 56 | + vsync_cb_handler = NULL; | ||
| 57 | + vsync_cb_arg = NULL; | ||
| 58 | + } else { | ||
| 59 | + return -ENXIO; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + return 0; | ||
| 63 | +} | ||
| 64 | +EXPORT_SYMBOL(unregister_vsync_cb); | ||
| 65 | + | ||
| 66 | irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) | ||
| 67 | { | ||
| 68 | struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); | ||
| 69 | @@ -610,6 +640,10 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) | ||
| 70 | tilcdc_crtc->event = NULL; | ||
| 71 | if (event) | ||
| 72 | drm_send_vblank_event(dev, 0, event); | ||
| 73 | + | ||
| 74 | + if (vsync_cb_handler) | ||
| 75 | + vsync_cb_handler(vsync_cb_arg); | ||
| 76 | + | ||
| 77 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 78 | |||
| 79 | if (dirty && !tilcdc_crtc->dirty) | ||
| 80 | diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h | ||
| 81 | index 0938036..05269be 100644 | ||
| 82 | --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h | ||
| 83 | +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h | ||
| 84 | @@ -170,4 +170,9 @@ void tilcdc_crtc_set_panel_info(struct drm_crtc *crtc, | ||
| 85 | int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode); | ||
| 86 | int tilcdc_crtc_max_width(struct drm_crtc *crtc); | ||
| 87 | |||
| 88 | +/* used by SGX OMAPLFB drvier */ | ||
| 89 | +typedef void (*vsync_callback_t)(void *arg); | ||
| 90 | +int register_vsync_cb(vsync_callback_t handler, void *arg, int idx); | ||
| 91 | +int unregister_vsync_cb(vsync_callback_t handler, void *arg, int idx); | ||
| 92 | + | ||
| 93 | #endif /* __TILCDC_DRV_H__ */ | ||
| 94 | -- | ||
| 95 | 1.9.1 | ||
| 96 | |||
diff --git a/recipes-kernel/linux/linux-ti-staging-3.14/sgx/0003-drm-tilcdc-fix-the-ping-pong-dma-tearing-issue-seen-.patch b/recipes-kernel/linux/linux-ti-staging-3.14/sgx/0003-drm-tilcdc-fix-the-ping-pong-dma-tearing-issue-seen-.patch deleted file mode 100644 index b3d04661..00000000 --- a/recipes-kernel/linux/linux-ti-staging-3.14/sgx/0003-drm-tilcdc-fix-the-ping-pong-dma-tearing-issue-seen-.patch +++ /dev/null | |||
| @@ -1,97 +0,0 @@ | |||
| 1 | From 7b4400287144101f8c7bdf2a9fa45c82859177e2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Darren Etheridge <detheridge@ti.com> | ||
| 3 | Date: Fri, 18 Jul 2014 16:21:46 -0500 | ||
| 4 | Subject: [PATCH 3/6] drm/tilcdc: fix the ping-pong dma tearing issue seen on | ||
| 5 | buffer flipping | ||
| 6 | |||
| 7 | Update the DMA pointers during the pan display ioctl. Borrowed from | ||
| 8 | da8xx_fb.c update the scanout buffers immediately so the DMA ping/pong | ||
| 9 | doesn't end up out of sync with what we really want it to DMA. | ||
| 10 | |||
| 11 | Signed-off-by: Darren Etheridge <detheridge@ti.com> | ||
| 12 | --- | ||
| 13 | drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 36 +++++++++++++++++++++++++++++++----- | ||
| 14 | 1 file changed, 31 insertions(+), 5 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | ||
| 17 | index bf94a0f..cdea159 100644 | ||
| 18 | --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | ||
| 19 | +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | ||
| 20 | @@ -30,6 +30,8 @@ struct tilcdc_crtc { | ||
| 21 | int dpms; | ||
| 22 | wait_queue_head_t frame_done_wq; | ||
| 23 | bool frame_done; | ||
| 24 | + spinlock_t irq_lock; | ||
| 25 | + int dma_completed_channel; | ||
| 26 | |||
| 27 | /* fb currently set to scanout 0/1: */ | ||
| 28 | struct drm_framebuffer *scanout[2]; | ||
| 29 | @@ -102,10 +104,23 @@ static void update_scanout(struct drm_crtc *crtc) | ||
| 30 | (crtc->mode.vdisplay * fb->pitches[0]); | ||
| 31 | |||
| 32 | if (tilcdc_crtc->dpms == DRM_MODE_DPMS_ON) { | ||
| 33 | - /* already enabled, so just mark the frames that need | ||
| 34 | - * updating and they will be updated on vblank: | ||
| 35 | + /* | ||
| 36 | + * already enabled, so just mark the frames that need | ||
| 37 | + * updating and they will be updated on vblank | ||
| 38 | + * and update the inactive DMA channel immediately | ||
| 39 | + * to avoid any tearing due to the DMA already starting | ||
| 40 | + * on the pending dma buffer when we hit the vblank IRQ | ||
| 41 | */ | ||
| 42 | - tilcdc_crtc->dirty |= LCDC_END_OF_FRAME0 | LCDC_END_OF_FRAME1; | ||
| 43 | + if (tilcdc_crtc->dma_completed_channel == 0) { | ||
| 44 | + tilcdc_crtc->dirty |= LCDC_END_OF_FRAME1; | ||
| 45 | + set_scanout(crtc, 0); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + if (tilcdc_crtc->dma_completed_channel == 1) { | ||
| 49 | + tilcdc_crtc->dirty |= LCDC_END_OF_FRAME0; | ||
| 50 | + set_scanout(crtc, 1); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | drm_vblank_get(dev, 0); | ||
| 54 | } else { | ||
| 55 | /* not enabled yet, so update registers immediately: */ | ||
| 56 | @@ -612,6 +627,7 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) | ||
| 57 | struct drm_device *dev = crtc->dev; | ||
| 58 | struct tilcdc_drm_private *priv = dev->dev_private; | ||
| 59 | uint32_t stat = tilcdc_read_irqstatus(dev); | ||
| 60 | + unsigned long irq_flags; | ||
| 61 | |||
| 62 | if ((stat & LCDC_SYNC_LOST) && (stat & LCDC_FIFO_UNDERFLOW)) { | ||
| 63 | stop(crtc); | ||
| 64 | @@ -627,11 +643,19 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) | ||
| 65 | |||
| 66 | tilcdc_clear_irqstatus(dev, stat); | ||
| 67 | |||
| 68 | - if (dirty & LCDC_END_OF_FRAME0) | ||
| 69 | + spin_lock_irqsave(&tilcdc_crtc->irq_lock, irq_flags); | ||
| 70 | + | ||
| 71 | + if (dirty & LCDC_END_OF_FRAME0) { | ||
| 72 | set_scanout(crtc, 0); | ||
| 73 | + tilcdc_crtc->dma_completed_channel = 0; | ||
| 74 | + } | ||
| 75 | |||
| 76 | - if (dirty & LCDC_END_OF_FRAME1) | ||
| 77 | + if (dirty & LCDC_END_OF_FRAME1) { | ||
| 78 | set_scanout(crtc, 1); | ||
| 79 | + tilcdc_crtc->dma_completed_channel = 1; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, irq_flags); | ||
| 83 | |||
| 84 | drm_handle_vblank(dev, 0); | ||
| 85 | |||
| 86 | @@ -707,6 +731,8 @@ struct drm_crtc *tilcdc_crtc_create(struct drm_device *dev) | ||
| 87 | goto fail; | ||
| 88 | } | ||
| 89 | |||
| 90 | + spin_lock_init(&tilcdc_crtc->irq_lock); | ||
| 91 | + | ||
| 92 | ret = drm_crtc_init(dev, crtc, &tilcdc_crtc_funcs); | ||
| 93 | if (ret < 0) | ||
| 94 | goto fail; | ||
| 95 | -- | ||
| 96 | 1.9.1 | ||
| 97 | |||
diff --git a/recipes-kernel/linux/linux-ti-staging_3.14.bb b/recipes-kernel/linux/linux-ti-staging_3.14.bb index 2a458b74..4a613adc 100644 --- a/recipes-kernel/linux/linux-ti-staging_3.14.bb +++ b/recipes-kernel/linux/linux-ti-staging_3.14.bb | |||
| @@ -44,11 +44,11 @@ S = "${WORKDIR}/git" | |||
| 44 | 44 | ||
| 45 | BRANCH = "ti-linux-3.14.y" | 45 | BRANCH = "ti-linux-3.14.y" |
| 46 | 46 | ||
| 47 | SRCREV = "0627fb95826dbcaac164f051d7d0a694e59d709a" | 47 | SRCREV = "4247372d2f38f7346e34063d38ac4adb3fe053c2" |
| 48 | PV = "3.14.17" | 48 | PV = "3.14.17" |
| 49 | 49 | ||
| 50 | # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild | 50 | # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild |
| 51 | MACHINE_KERNEL_PR_append = "b+gitr${SRCPV}" | 51 | MACHINE_KERNEL_PR_append = "c+gitr${SRCPV}" |
| 52 | PR = "${MACHINE_KERNEL_PR}" | 52 | PR = "${MACHINE_KERNEL_PR}" |
| 53 | 53 | ||
| 54 | KERNEL_CONFIG_DIR = "${S}/ti_config_fragments" | 54 | KERNEL_CONFIG_DIR = "${S}/ti_config_fragments" |
| @@ -59,15 +59,7 @@ KERNEL_CONFIG_FRAGMENTS = "${KERNEL_CONFIG_DIR}/audio_display.cfg ${KERNEL_CONFI | |||
| 59 | KERNEL_CONFIG_FRAGMENTS_append_ti33x = " ${WORKDIR}/non-smp.cfg" | 59 | KERNEL_CONFIG_FRAGMENTS_append_ti33x = " ${WORKDIR}/non-smp.cfg" |
| 60 | KERNEL_CONFIG_FRAGMENTS_append_ti43x = " ${WORKDIR}/non-smp.cfg" | 60 | KERNEL_CONFIG_FRAGMENTS_append_ti43x = " ${WORKDIR}/non-smp.cfg" |
| 61 | 61 | ||
| 62 | # Patches necessary to make SGX graphics work with this kernel version | ||
| 63 | SGX_PATCHES = "file://sgx/0001-HACK-drm-fb_helper-enable-panning-support.patch \ | ||
| 64 | file://sgx/0002-HACK-drm-tilcdc-add-vsync-callback-for-use-in-omaplf.patch \ | ||
| 65 | file://sgx/0003-drm-tilcdc-fix-the-ping-pong-dma-tearing-issue-seen-.patch" | ||
| 66 | |||
| 67 | SRC_URI = "git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git;protocol=git;branch=${BRANCH} \ | 62 | SRC_URI = "git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git;protocol=git;branch=${BRANCH} \ |
| 68 | file://defconfig \ | 63 | file://defconfig \ |
| 69 | file://non-smp.cfg \ | 64 | file://non-smp.cfg \ |
| 70 | " | 65 | " |
| 71 | |||
| 72 | SRC_URI_append_ti33x = " ${SGX_PATCHES}" | ||
| 73 | SRC_URI_append_ti43x = " ${SGX_PATCHES}" | ||
