@@ -563,12 +563,6 @@ void dpu_crtc_res_put(struct drm_crtc_state *state, u32 type, u64 tag)
_dpu_crtc_rp_put(rp, type, tag);
}
-static void _dpu_crtc_deinit_events(struct dpu_crtc *dpu_crtc)
-{
- if (!dpu_crtc)
- return;
-}
-
static void dpu_crtc_destroy(struct drm_crtc *crtc)
{
struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
@@ -578,7 +572,6 @@ static void dpu_crtc_destroy(struct drm_crtc *crtc)
if (!crtc)
return;
- _dpu_crtc_deinit_events(dpu_crtc);
dpu_crtc->phandle = NULL;
drm_crtc_cleanup(crtc);
@@ -842,47 +835,6 @@ static void dpu_crtc_vblank_cb(void *data)
trace_dpu_crtc_vblank_cb(DRMID(crtc));
}
-/* _dpu_crtc_idle_notify - signal idle timeout to client */
-static void _dpu_crtc_idle_notify(struct dpu_crtc *dpu_crtc)
-{
- struct drm_crtc *crtc;
- struct drm_event event;
- int ret = 0;
-
- if (!dpu_crtc) {
- DPU_ERROR("invalid dpu crtc\n");
- return;
- }
-
- crtc = &dpu_crtc->base;
- event.type = DRM_EVENT_IDLE_NOTIFY;
- event.length = sizeof(u32);
- msm_mode_object_event_notify(&crtc->base, crtc->dev, &event,
- (u8 *)&ret);
-
- DPU_DEBUG("crtc:%d idle timeout notified\n", crtc->base.id);
-}
-
-/*
- * dpu_crtc_handle_event - crtc frame event handle.
- * This API must manage only non-IRQ context events.
- */
-static bool _dpu_crtc_handle_event(struct dpu_crtc *dpu_crtc, u32 event)
-{
- bool event_processed = false;
-
- /**
- * idle events are originated from commit thread and can be processed
- * in same context
- */
- if (event & DPU_ENCODER_FRAME_EVENT_IDLE) {
- _dpu_crtc_idle_notify(dpu_crtc);
- event_processed = true;
- }
-
- return event_processed;
-}
-
static void dpu_crtc_frame_event_work(struct kthread_work *work)
{
struct msm_drm_private *priv;
@@ -977,23 +929,22 @@ static void dpu_crtc_frame_event_cb(void *data, u32 event)
struct dpu_crtc_frame_event *fevent;
unsigned long flags;
u32 crtc_id;
- bool event_processed = false;
if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
DPU_ERROR("invalid parameters\n");
return;
}
+
+ /* Nothing to do on idle event */
+ if (event & DPU_ENCODER_FRAME_EVENT_IDLE)
+ return;
+
dpu_crtc = to_dpu_crtc(crtc);
priv = crtc->dev->dev_private;
crtc_id = drm_crtc_index(crtc);
trace_dpu_crtc_frame_event_cb(DRMID(crtc), event);
- /* try to process the event in caller context */
- event_processed = _dpu_crtc_handle_event(dpu_crtc, event);
- if (event_processed)
- return;
-
spin_lock_irqsave(&dpu_crtc->spin_lock, flags);
fevent = list_first_entry_or_null(&dpu_crtc->frame_event_list,
struct dpu_crtc_frame_event, list);
@@ -1665,8 +1616,6 @@ static void dpu_crtc_disable(struct drm_crtc *crtc)
struct drm_display_mode *mode;
struct drm_encoder *encoder;
struct msm_drm_private *priv;
- struct drm_event event;
- u32 power_on;
int ret;
if (!crtc || !crtc->dev || !crtc->dev->dev_private || !crtc->state) {
@@ -1685,13 +1634,6 @@ static void dpu_crtc_disable(struct drm_crtc *crtc)
mutex_lock(&dpu_crtc->crtc_lock);
- /* update color processing on suspend */
- event.type = DRM_EVENT_CRTC_POWER;
- event.length = sizeof(u32);
- power_on = 0;
- msm_mode_object_event_notify(&crtc->base, crtc->dev, &event,
- (u8 *)&power_on);
-
/* wait for frame_event_done completion */
if (_dpu_crtc_wait_for_frame_done(crtc))
DPU_ERROR("crtc%d wait for frame done failed;frame_pending%d\n",
@@ -1745,8 +1687,6 @@ static void dpu_crtc_enable(struct drm_crtc *crtc,
struct dpu_crtc *dpu_crtc;
struct drm_encoder *encoder;
struct msm_drm_private *priv;
- struct drm_event event;
- u32 power_on;
int ret;
if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
@@ -1776,13 +1716,6 @@ static void dpu_crtc_enable(struct drm_crtc *crtc,
}
dpu_crtc->enabled = true;
- /* update color processing on resume */
- event.type = DRM_EVENT_CRTC_POWER;
- event.length = sizeof(u32);
- power_on = 1;
- msm_mode_object_event_notify(&crtc->base, crtc->dev, &event,
- (u8 *)&power_on);
-
mutex_unlock(&dpu_crtc->crtc_lock);
dpu_crtc->power_event = dpu_power_handle_register_event(
@@ -1,5 +1,4 @@
/*
- * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
* Copyright (C) 2014 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
*
@@ -21,7 +20,7 @@
#include "msm_kms.h"
static void msm_atomic_wait_for_commit_done(struct drm_device *dev,
- struct drm_atomic_state *old_state)
+ struct drm_atomic_state *old_state)
{
struct drm_crtc *crtc;
struct drm_crtc_state *new_crtc_state;
@@ -15,27 +15,6 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/*
- * Copyright (c) 2016 Intel Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
#include <linux/debugfs.h>
#include <linux/of_address.h>
@@ -137,8 +116,7 @@ void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
- dev_warn(&pdev->dev, "memory resource: %s not available\n",
- name);
+ dev_err(&pdev->dev, "failed to get memory resource: %s\n", name);
return ERR_PTR(-EINVAL);
}
@@ -189,7 +167,6 @@ void msm_writel(u32 data, void __iomem *addr)
u32 msm_readl(const void __iomem *addr)
{
u32 val = readl(addr);
-
if (reglog)
pr_err("IO:R %p %08x\n", addr, val);
return val;
@@ -340,10 +317,10 @@ static int msm_drm_uninit(struct device *dev)
mdss->funcs->destroy(ddev);
ddev->dev_private = NULL;
- kfree(priv);
-
drm_dev_unref(ddev);
+ kfree(priv);
+
return 0;
}
@@ -465,9 +442,9 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
struct sched_param param;
ddev = drm_dev_alloc(drv, dev);
- if (!ddev) {
+ if (IS_ERR(ddev)) {
dev_err(dev, "failed to allocate drm_device\n");
- return -ENOMEM;
+ return PTR_ERR(ddev);
}
platform_set_drvdata(pdev, ddev);
@@ -551,21 +528,14 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
* and (for example) use dmabuf/prime to share buffers with
* imx drm driver on iMX5
*/
- priv->kms = NULL;
dev_err(dev, "failed to load kms\n");
ret = PTR_ERR(kms);
goto fail;
}
priv->kms = kms;
- /**
- * Since kms->funcs->hw_init(kms) might call
- * drm_object_property_set_value we need to make sure
- * mode_config.funcs is initialized first to avoid dereferencing
- * an unset value during call to drm_drv_uses_atomic_modeset()
- */
- ddev->mode_config.funcs = &mode_config_funcs;
- ddev->mode_config.helper_private = &mode_config_helper_funcs;
+ /* Enable normalization of plane zpos */
+ ddev->mode_config.normalize_zpos = true;
/* Enable normalization of plane zpos */
ddev->mode_config.normalize_zpos = true;
@@ -578,6 +548,9 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
}
}
+ ddev->mode_config.funcs = &mode_config_funcs;
+ ddev->mode_config.helper_private = &mode_config_helper_funcs;
+
/**
* this priority was found during empiric testing to have appropriate
* realtime scheduling to process display updates and interact with
@@ -734,11 +707,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
* DRM operations:
*/
-#ifdef CONFIG_QCOM_KGSL
-static void load_gpu(struct drm_device *dev)
-{
-}
-#else
static void load_gpu(struct drm_device *dev)
{
static DEFINE_MUTEX(init_lock);
@@ -751,7 +719,6 @@ static void load_gpu(struct drm_device *dev)
mutex_unlock(&init_lock);
}
-#endif
static int context_init(struct drm_device *dev, struct drm_file *file)
{
@@ -822,7 +789,6 @@ static irqreturn_t msm_irq(int irq, void *arg)
struct drm_device *dev = arg;
struct msm_drm_private *priv = dev->dev_private;
struct msm_kms *kms = priv->kms;
-
BUG_ON(!kms);
return kms->funcs->irq(kms);
}
@@ -831,7 +797,6 @@ static void msm_irq_preinstall(struct drm_device *dev)
{
struct msm_drm_private *priv = dev->dev_private;
struct msm_kms *kms = priv->kms;
-
BUG_ON(!kms);
kms->funcs->irq_preinstall(kms);
}
@@ -840,7 +805,6 @@ static int msm_irq_postinstall(struct drm_device *dev)
{
struct msm_drm_private *priv = dev->dev_private;
struct msm_kms *kms = priv->kms;
-
BUG_ON(!kms);
return kms->funcs->irq_postinstall(kms);
}
@@ -849,7 +813,6 @@ static void msm_irq_uninstall(struct drm_device *dev)
{
struct msm_drm_private *priv = dev->dev_private;
struct msm_kms *kms = priv->kms;
-
BUG_ON(!kms);
kms->funcs->irq_uninstall(kms);
}
@@ -858,7 +821,6 @@ static int msm_enable_vblank(struct drm_device *dev, unsigned int pipe)
{
struct msm_drm_private *priv = dev->dev_private;
struct msm_kms *kms = priv->kms;
-
if (!kms)
return -ENXIO;
DBG("dev=%p, crtc=%u", dev, pipe);
@@ -869,7 +831,6 @@ static void msm_disable_vblank(struct drm_device *dev, unsigned int pipe)
{
struct msm_drm_private *priv = dev->dev_private;
struct msm_kms *kms = priv->kms;
-
if (!kms)
return;
DBG("dev=%p, crtc=%u", dev, pipe);
@@ -1091,164 +1052,6 @@ static int msm_ioctl_submitqueue_close(struct drm_device *dev, void *data,
return msm_submitqueue_remove(file->driver_priv, id);
}
-void msm_mode_object_event_notify(struct drm_mode_object *obj,
- struct drm_device *dev, struct drm_event *event, u8 *payload)
-{
- struct msm_drm_private *priv = NULL;
- unsigned long flags;
- struct msm_drm_event *notify, *node;
- int len = 0, ret;
-
- if (!obj || !event || !event->length || !payload) {
- DRM_ERROR("err param obj %pK event %pK len %d payload %pK\n",
- obj, event, ((event) ? (event->length) : -1),
- payload);
- return;
- }
- priv = (dev) ? dev->dev_private : NULL;
- if (!dev || !priv) {
- DRM_ERROR("invalid dev %pK priv %pK\n", dev, priv);
- return;
- }
-
- spin_lock_irqsave(&dev->event_lock, flags);
- list_for_each_entry(node, &priv->client_event_list, base.link) {
- if (node->event.type != event->type ||
- obj->id != node->info.object_id)
- continue;
- len = event->length + sizeof(struct drm_msm_event_resp);
- if (node->base.file_priv->event_space < len) {
- DRM_ERROR("Insufficient space to notify\n");
- continue;
- }
- notify = kzalloc(len, GFP_ATOMIC);
- if (!notify)
- continue;
- notify->base.file_priv = node->base.file_priv;
- notify->base.event = ¬ify->event;
- notify->event.type = node->event.type;
- notify->event.length = len;
- memcpy(¬ify->info, &node->info, sizeof(notify->info));
- memcpy(notify->data, payload, event->length);
- ret = drm_event_reserve_init_locked(dev, node->base.file_priv,
- ¬ify->base, ¬ify->event);
- if (ret) {
- kfree(notify);
- continue;
- }
- drm_send_event_locked(dev, ¬ify->base);
- }
- spin_unlock_irqrestore(&dev->event_lock, flags);
-}
-
-static int msm_release(struct inode *inode, struct file *filp)
-{
- return drm_release(inode, filp);
-}
-
-/**
- * msm_drv_framebuffer_remove - remove and unreference a framebuffer object
- * @fb: framebuffer to remove
- */
-void msm_drv_framebuffer_remove(struct drm_framebuffer *fb)
-{
- struct drm_device *dev;
-
- if (!fb)
- return;
-
- dev = fb->dev;
-
- WARN_ON(!list_empty(&fb->filp_head));
-
- drm_framebuffer_unreference(fb);
-}
-
-struct msm_drv_rmfb2_work {
- struct work_struct work;
- struct list_head fbs;
-};
-
-static void msm_drv_rmfb2_work_fn(struct work_struct *w)
-{
- struct msm_drv_rmfb2_work *arg = container_of(w, typeof(*arg), work);
-
- while (!list_empty(&arg->fbs)) {
- struct drm_framebuffer *fb =
- list_first_entry(&arg->fbs, typeof(*fb), filp_head);
-
- list_del_init(&fb->filp_head);
- msm_drv_framebuffer_remove(fb);
- }
-}
-
-/**
- * msm_ioctl_rmfb2 - remove an FB from the configuration
- * @dev: drm device for the ioctl
- * @data: data pointer for the ioctl
- * @file_priv: drm file for the ioctl call
- *
- * Remove the FB specified by the user.
- *
- * Called by the user via ioctl.
- *
- * Returns:
- * Zero on success, negative errno on failure.
- */
-int msm_ioctl_rmfb2(struct drm_device *dev, void *data,
- struct drm_file *file_priv)
-{
- struct drm_framebuffer *fb = NULL;
- struct drm_framebuffer *fbl = NULL;
- uint32_t *id = data;
- int found = 0;
-
- if (!drm_core_check_feature(dev, DRIVER_MODESET))
- return -EINVAL;
-
- fb = drm_framebuffer_lookup(dev, file_priv, *id);
- if (!fb)
- return -ENOENT;
-
- /* drop extra ref from traversing drm_framebuffer_lookup */
- drm_framebuffer_unreference(fb);
-
- mutex_lock(&file_priv->fbs_lock);
- list_for_each_entry(fbl, &file_priv->fbs, filp_head)
- if (fb == fbl)
- found = 1;
- if (!found) {
- mutex_unlock(&file_priv->fbs_lock);
- return -ENOENT;
- }
-
- list_del_init(&fb->filp_head);
- mutex_unlock(&file_priv->fbs_lock);
-
- /*
- * we now own the reference that was stored in the fbs list
- *
- * drm_framebuffer_remove may fail with -EINTR on pending signals,
- * so run this in a separate stack as there's no way to correctly
- * handle this after the fb is already removed from the lookup table.
- */
- if (drm_framebuffer_read_refcount(fb) > 1) {
- struct msm_drv_rmfb2_work arg;
-
- INIT_WORK_ONSTACK(&arg.work, msm_drv_rmfb2_work_fn);
- INIT_LIST_HEAD(&arg.fbs);
- list_add_tail(&fb->filp_head, &arg.fbs);
-
- schedule_work(&arg.work);
- flush_work(&arg.work);
- destroy_work_on_stack(&arg.work);
- } else
- drm_framebuffer_unreference(fb);
-
- return 0;
-}
-EXPORT_SYMBOL(msm_ioctl_rmfb2);
-
static const struct drm_ioctl_desc msm_ioctls[] = {
DRM_IOCTL_DEF_DRV(MSM_GET_PARAM, msm_ioctl_get_param, DRM_AUTH|DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(MSM_GEM_NEW, msm_ioctl_gem_new, DRM_AUTH|DRM_RENDER_ALLOW),
@@ -1260,8 +1063,6 @@ static const struct drm_ioctl_desc msm_ioctls[] = {
DRM_IOCTL_DEF_DRV(MSM_GEM_MADVISE, msm_ioctl_gem_madvise, DRM_AUTH|DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(MSM_SUBMITQUEUE_NEW, msm_ioctl_submitqueue_new, DRM_AUTH|DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(MSM_SUBMITQUEUE_CLOSE, msm_ioctl_submitqueue_close, DRM_AUTH|DRM_RENDER_ALLOW),
- DRM_IOCTL_DEF_DRV(MSM_RMFB2, msm_ioctl_rmfb2,
- DRM_CONTROL_ALLOW|DRM_UNLOCKED),
};
static const struct vm_operations_struct vm_ops = {
@@ -1273,7 +1074,7 @@ static const struct vm_operations_struct vm_ops = {
static const struct file_operations fops = {
.owner = THIS_MODULE,
.open = drm_open,
- .release = msm_release,
+ .release = drm_release,
.unlocked_ioctl = drm_ioctl,
.compat_ioctl = drm_compat_ioctl,
.poll = drm_poll,
@@ -1336,10 +1137,10 @@ static int msm_pm_suspend(struct device *dev)
struct msm_drm_private *priv = ddev->dev_private;
struct msm_kms *kms = priv->kms;
+ /* TODO: Use atomic helper suspend/resume */
if (kms && kms->funcs && kms->funcs->pm_suspend)
return kms->funcs->pm_suspend(dev);
- /* disable hot-plug polling */
drm_kms_helper_poll_disable(ddev);
priv->pm_state = drm_atomic_helper_suspend(ddev);
@@ -1357,12 +1158,12 @@ static int msm_pm_resume(struct device *dev)
struct msm_drm_private *priv = ddev->dev_private;
struct msm_kms *kms = priv->kms;
+ /* TODO: Use atomic helper suspend/resume */
if (kms && kms->funcs && kms->funcs->pm_resume)
return kms->funcs->pm_resume(dev);
drm_atomic_helper_resume(ddev, priv->pm_state);
- /* enable hot-plug polling */
drm_kms_helper_poll_enable(ddev);
return 0;
@@ -1488,7 +1289,7 @@ static int compare_name_mdp(struct device *dev, void *data)
static int add_display_components(struct device *dev,
struct component_match **matchptr)
{
- struct device *mdp_dev = NULL;
+ struct device *mdp_dev;
int ret;
/*
@@ -1498,7 +1299,7 @@ static int add_display_components(struct device *dev,
* the interfaces to our components list.
*/
if (of_device_is_compatible(dev->of_node, "qcom,mdss") ||
- of_device_is_compatible(dev->of_node, "qcom,dpu-mdss")) {
+ of_device_is_compatible(dev->of_node, "qcom,dpu-mdss")) {
ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
if (ret) {
dev_err(dev, "failed to populate children devices\n");
@@ -1516,7 +1317,7 @@ static int add_display_components(struct device *dev,
/* add the MDP component itself */
drm_of_component_match_add(dev, matchptr, compare_of,
- mdp_dev->of_node);
+ mdp_dev->of_node);
} else {
/* MDP4 */
mdp_dev = dev;
@@ -1541,13 +1342,6 @@ static const struct of_device_id msm_gpu_match[] = {
{ },
};
-#ifdef CONFIG_QCOM_KGSL
-static int add_gpu_components(struct device *dev,
- struct component_match **matchptr)
-{
- return 0;
-}
-#else
static int add_gpu_components(struct device *dev,
struct component_match **matchptr)
{
@@ -1563,7 +1357,6 @@ static int add_gpu_components(struct device *dev,
return 0;
}
-#endif
static int msm_drm_bind(struct device *dev)
{
@@ -1597,7 +1390,12 @@ static int msm_pdev_probe(struct platform_device *pdev)
if (ret)
return ret;
- pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+ /* on all devices that I am aware of, iommu's which can map
+ * any address the cpu can see are used:
+ */
+ ret = dma_set_mask_and_coherent(&pdev->dev, ~0);
+ if (ret)
+ return ret;
return component_master_add_with_match(&pdev->dev, &msm_drm_ops, match);
}
@@ -76,9 +76,9 @@ struct msm_file_private {
enum msm_mdp_plane_property {
/* range properties */
PLANE_PROP_ZPOS,
-
- /* total # of properties */
- PLANE_PROP_COUNT
+ PLANE_PROP_ALPHA,
+ PLANE_PROP_PREMULTIPLIED,
+ PLANE_PROP_MAX_NUM,
};
struct msm_vblank_ctrl {
@@ -90,16 +90,6 @@ struct msm_vblank_ctrl {
#define MSM_GPU_MAX_RINGS 4
#define MAX_H_TILES_PER_DISPLAY 2
-/**
- * enum msm_display_compression_type - compression method used for pixel stream
- * @MSM_DISPLAY_COMPRESSION_NONE: Pixel data is not compressed
- * @MSM_DISPLAY_COMPRESSION_DSC: DSC compresison is used
- */
-enum msm_display_compression_type {
- MSM_DISPLAY_COMPRESSION_NONE,
- MSM_DISPLAY_COMPRESSION_DSC,
-};
-
/**
* enum msm_display_caps - features/capabilities supported by displays
* @MSM_DISPLAY_CAP_VID_MODE: Video or "active" mode supported
@@ -126,111 +116,6 @@ enum msm_event_wait {
MSM_ENC_VBLANK,
};
-/**
- * struct msm_display_dsc_info - defines dsc configuration
- * @version: DSC version.
- * @scr_rev: DSC revision.
- * @pic_height: Picture height in pixels.
- * @pic_width: Picture width in pixels.
- * @initial_lines: Number of initial lines stored in encoder.
- * @pkt_per_line: Number of packets per line.
- * @bytes_in_slice: Number of bytes in slice.
- * @eol_byte_num: Valid bytes at the end of line.
- * @pclk_per_line: Compressed width.
- * @full_frame_slices: Number of slice per interface.
- * @slice_height: Slice height in pixels.
- * @slice_width: Slice width in pixels.
- * @chunk_size: Chunk size in bytes for slice multiplexing.
- * @slice_last_group_size: Size of last group in pixels.
- * @bpp: Target bits per pixel.
- * @bpc: Number of bits per component.
- * @line_buf_depth: Line buffer bit depth.
- * @block_pred_enable: Block prediction enabled/disabled.
- * @vbr_enable: VBR mode.
- * @enable_422: Indicates if input uses 4:2:2 sampling.
- * @convert_rgb: DSC color space conversion.
- * @input_10_bits: 10 bit per component input.
- * @slice_per_pkt: Number of slices per packet.
- * @initial_dec_delay: Initial decoding delay.
- * @initial_xmit_delay: Initial transmission delay.
- * @initial_scale_value: Scale factor value at the beginning of a slice.
- * @scale_decrement_interval: Scale set up at the beginning of a slice.
- * @scale_increment_interval: Scale set up at the end of a slice.
- * @first_line_bpg_offset: Extra bits allocated on the first line of a slice.
- * @nfl_bpg_offset: Slice specific settings.
- * @slice_bpg_offset: Slice specific settings.
- * @initial_offset: Initial offset at the start of a slice.
- * @final_offset: Maximum end-of-slice value.
- * @rc_model_size: Number of bits in RC model.
- * @det_thresh_flatness: Flatness threshold.
- * @max_qp_flatness: Maximum QP for flatness adjustment.
- * @min_qp_flatness: Minimum QP for flatness adjustment.
- * @edge_factor: Ratio to detect presence of edge.
- * @quant_incr_limit0: QP threshold.
- * @quant_incr_limit1: QP threshold.
- * @tgt_offset_hi: Upper end of variability range.
- * @tgt_offset_lo: Lower end of variability range.
- * @buf_thresh: Thresholds in RC model
- * @range_min_qp: Min QP allowed.
- * @range_max_qp: Max QP allowed.
- * @range_bpg_offset: Bits per group adjustment.
- */
-struct msm_display_dsc_info {
- u8 version;
- u8 scr_rev;
-
- int pic_height;
- int pic_width;
- int slice_height;
- int slice_width;
-
- int initial_lines;
- int pkt_per_line;
- int bytes_in_slice;
- int bytes_per_pkt;
- int eol_byte_num;
- int pclk_per_line;
- int full_frame_slices;
- int slice_last_group_size;
- int bpp;
- int bpc;
- int line_buf_depth;
-
- int slice_per_pkt;
- int chunk_size;
- bool block_pred_enable;
- int vbr_enable;
- int enable_422;
- int convert_rgb;
- int input_10_bits;
-
- int initial_dec_delay;
- int initial_xmit_delay;
- int initial_scale_value;
- int scale_decrement_interval;
- int scale_increment_interval;
- int first_line_bpg_offset;
- int nfl_bpg_offset;
- int slice_bpg_offset;
- int initial_offset;
- int final_offset;
-
- int rc_model_size;
- int det_thresh_flatness;
- int max_qp_flatness;
- int min_qp_flatness;
- int edge_factor;
- int quant_incr_limit0;
- int quant_incr_limit1;
- int tgt_offset_hi;
- int tgt_offset_lo;
-
- u32 *buf_thresh;
- char *range_min_qp;
- char *range_max_qp;
- char *range_bpg_offset;
-};
-
/**
* struct msm_display_topology - defines a display topology pipeline
* @num_lm: number of layer mixers used
@@ -261,21 +146,6 @@ struct msm_display_info {
bool is_te_using_watchdog_timer;
};
-/**
- * struct msm_drm_event - defines custom event notification struct
- * @base: base object required for event notification by DRM framework.
- * @event: event object required for event notification by DRM framework.
- * @info: contains information of DRM object for which events has been
- * requested.
- * @data: memory location which contains response payload for event.
- */
-struct msm_drm_event {
- struct drm_pending_event base;
- struct drm_event event;
- struct drm_msm_event_req info;
- u8 data[];
-};
-
/* Commit/Event thread specific structure */
struct msm_drm_thread {
struct drm_device *dev;
@@ -344,10 +214,7 @@ struct msm_drm_private {
struct drm_connector *connectors[MAX_CONNECTORS];
/* Properties */
- struct drm_property *plane_property[PLANE_PROP_COUNT];
-
- /* Color processing properties for the crtc */
- struct drm_property **cp_property;
+ struct drm_property *plane_property[PLANE_PROP_MAX_NUM];
/* VRAM carveout, used when no IOMMU: */
struct {
@@ -442,7 +309,7 @@ void msm_gem_prime_unpin(struct drm_gem_object *obj);
void *msm_gem_get_vaddr(struct drm_gem_object *obj);
void *msm_gem_get_vaddr_active(struct drm_gem_object *obj);
void msm_gem_put_vaddr(struct drm_gem_object *obj);
-int msm_gem_madvise(struct drm_gem_object *obj, unsigned int madv);
+int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv);
int msm_gem_sync_object(struct drm_gem_object *obj,
struct msm_fence_context *fctx, bool exclusive);
void msm_gem_move_to_active(struct drm_gem_object *obj,
@@ -481,7 +348,7 @@ struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
struct drm_gem_object **bos);
struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd);
-struct drm_framebuffer *msm_alloc_stolen_fb(struct drm_device *dev,
+struct drm_framebuffer * msm_alloc_stolen_fb(struct drm_device *dev,
int w, int h, int p, uint32_t format);
struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev);
@@ -501,15 +368,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
struct msm_dsi;
-/* *
- * msm_mode_object_event_notify - notify user-space clients of drm object
- * events.
- * @obj: mode object (crtc/connector) that is generating the event.
- * @event: event that needs to be notified.
- * @payload: payload for the event.
- */
-void msm_mode_object_event_notify(struct drm_mode_object *obj,
- struct drm_device *dev, struct drm_event *event, u8 *payload);
#ifdef CONFIG_DRM_MSM_DSI
void __init msm_dsi_register(void);
void __exit msm_dsi_unregister(void);
@@ -43,13 +43,9 @@ struct msm_kms_funcs {
int (*enable_vblank)(struct msm_kms *kms, struct drm_crtc *crtc);
void (*disable_vblank)(struct msm_kms *kms, struct drm_crtc *crtc);
/* modeset, bracketing atomic_commit(): */
- void (*prepare_fence)(struct msm_kms *kms,
- struct drm_atomic_state *state);
- void (*prepare_commit)(struct msm_kms *kms,
- struct drm_atomic_state *state);
+ void (*prepare_commit)(struct msm_kms *kms, struct drm_atomic_state *state);
void (*commit)(struct msm_kms *kms, struct drm_atomic_state *state);
- void (*complete_commit)(struct msm_kms *kms,
- struct drm_atomic_state *state);
+ void (*complete_commit)(struct msm_kms *kms, struct drm_atomic_state *state);
/* functions to wait for atomic commit completed on each CRTC */
void (*wait_for_crtc_commit_done)(struct msm_kms *kms,
struct drm_crtc *crtc);
@@ -108,13 +108,9 @@ struct msm_rd_state {
static void rd_write(struct msm_rd_state *rd, const void *buf, int sz)
{
- struct circ_buf *fifo;
+ struct circ_buf *fifo = &rd->fifo;
const char *ptr = buf;
- if (!rd || !buf)
- return;
-
- fifo = &rd->fifo;
while (sz > 0) {
char *fptr = &fifo->buf[fifo->head];
int n;
@@ -147,18 +143,11 @@ static void rd_write_section(struct msm_rd_state *rd,
static ssize_t rd_read(struct file *file, char __user *buf,
size_t sz, loff_t *ppos)
{
- struct msm_rd_state *rd;
- struct circ_buf *fifo;
- const char *fptr;
+ struct msm_rd_state *rd = file->private_data;
+ struct circ_buf *fifo = &rd->fifo;
+ const char *fptr = &fifo->buf[fifo->tail];
int n = 0, ret = 0;
- if (!file || !file->private_data || !buf || !ppos)
- return -EINVAL;
-
- rd = file->private_data;
- fifo = &rd->fifo;
- fptr = &fifo->buf[fifo->tail];
-
mutex_lock(&rd->read_lock);
ret = wait_event_interruptible(rd->fifo_event,
@@ -190,26 +179,14 @@ static ssize_t rd_read(struct file *file, char __user *buf,
static int rd_open(struct inode *inode, struct file *file)
{
- struct msm_rd_state *rd;
- struct drm_device *dev;
- struct msm_drm_private *priv;
- struct msm_gpu *gpu;
+ struct msm_rd_state *rd = inode->i_private;
+ struct drm_device *dev = rd->dev;
+ struct msm_drm_private *priv = dev->dev_private;
+ struct msm_gpu *gpu = priv->gpu;
uint64_t val;
uint32_t gpu_id;
int ret = 0;
- if (!file || !inode || !inode->i_private)
- return -EINVAL;
-
- rd = inode->i_private;
- dev = rd->dev;
-
- if (!dev || !dev->dev_private)
- return -EINVAL;
-
- priv = dev->dev_private;
- gpu = priv->gpu;
-
mutex_lock(&dev->struct_mutex);
if (rd->open || !gpu) {
@@ -238,12 +215,7 @@ static int rd_open(struct inode *inode, struct file *file)
static int rd_release(struct inode *inode, struct file *file)
{
- struct msm_rd_state *rd;
-
- if (!inode || !inode->i_private)
- return -EINVAL;
-
- rd = inode->i_private;
+ struct msm_rd_state *rd = inode->i_private;
rd->open = false;
return 0;
}
@@ -380,17 +352,12 @@ static void snapshot_buf(struct msm_rd_state *rd,
void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
const char *fmt, ...)
{
- struct drm_device *dev;
+ struct drm_device *dev = submit->dev;
struct task_struct *task;
char msg[256];
int i, n;
- if (!submit || !submit->dev || !submit->dev->dev_private)
- return;
-
- dev = submit->dev;
-
- if (!rd || !rd->open)
+ if (!rd->open)
return;
/* writing into fifo is serialized by caller, and
@@ -21,15 +21,12 @@ struct mipi_dsi_device;
#define MIPI_DSI_MSG_REQ_ACK BIT(0)
/* use Low Power Mode to transmit message */
#define MIPI_DSI_MSG_USE_LPM BIT(1)
-/* read mipi_dsi_msg.ctrl and unicast to only that ctrls */
-#define MIPI_DSI_MSG_UNICAST BIT(2)
/**
* struct mipi_dsi_msg - read/write DSI buffer
* @channel: virtual channel id
* @type: payload data type
* @flags: flags controlling this message transmission
- * @ctrl: ctrl index to transmit on
* @tx_len: length of @tx_buf
* @tx_buf: data to be written
* @rx_len: length of @rx_buf
@@ -39,7 +36,6 @@ struct mipi_dsi_msg {
u8 channel;
u8 type;
u16 flags;
- u32 ctrl;
size_t tx_len;
const void *tx_buf;
deleted file mode 100644
@@ -1,182 +0,0 @@
-/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef _MSM_EXT_DISPLAY_H_
-#define _MSM_EXT_DISPLAY_H_
-
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/extcon.h>
-
-#define AUDIO_ACK_SET_ENABLE BIT(5)
-#define AUDIO_ACK_ENABLE BIT(4)
-#define AUDIO_ACK_CONNECT BIT(0)
-
-/*
- * Flags to be used with the HPD operation of the external display
- * interface:
- * MSM_EXT_DISP_HPD_AUDIO: audio will be routed to external display
- * MSM_EXT_DISP_HPD_VIDEO: video will be routed to external display
- */
-#define MSM_EXT_DISP_HPD_AUDIO BIT(0)
-#define MSM_EXT_DISP_HPD_VIDEO BIT(1)
-
-/**
- * struct ext_disp_cable_notify - cable notify handler structure
- * @link: a link for the linked list
- * @status: current status of HDMI/DP cable connection
- * @hpd_notify: callback function to provide cable status
- */
-struct ext_disp_cable_notify {
- struct list_head link;
- int status;
- void (*hpd_notify)(struct ext_disp_cable_notify *h);
-};
-
-struct msm_ext_disp_audio_edid_blk {
- u8 *audio_data_blk;
- unsigned int audio_data_blk_size; /* in bytes */
- u8 *spk_alloc_data_blk;
- unsigned int spk_alloc_data_blk_size; /* in bytes */
-};
-
-struct msm_ext_disp_audio_setup_params {
- u32 sample_rate_hz;
- u32 num_of_channels;
- u32 channel_allocation;
- u32 level_shift;
- bool down_mix;
- u32 sample_present;
-};
-
-/*
- * External Display identifier for use to determine which interface
- * the audio driver is interacting with.
- */
-enum msm_ext_disp_type {
- EXT_DISPLAY_TYPE_HDMI = EXTCON_DISP_HDMI,
- EXT_DISPLAY_TYPE_DP = EXTCON_DISP_DP,
- EXT_DISPLAY_TYPE_MAX = 0xFFFFFFFF
-};
-
-/*
- * External Display cable state used by display interface to indicate
- * connect/disconnect of interface.
- */
-enum msm_ext_disp_cable_state {
- EXT_DISPLAY_CABLE_DISCONNECT,
- EXT_DISPLAY_CABLE_CONNECT,
- EXT_DISPLAY_CABLE_STATE_MAX
-};
-
-/**
- * External Display power state used by display interface to indicate
- * power on/off of the interface.
- */
-enum msm_ext_disp_power_state {
- EXT_DISPLAY_POWER_OFF,
- EXT_DISPLAY_POWER_ON,
- EXT_DISPLAY_POWER_MAX
-};
-
-/**
- * struct msm_ext_disp_intf_ops - operations exposed to display interface
- * @audio_config: configures the audio operations exposed to codec driver
- * @audio_notify: notifies the audio connection state to user modules.
- * @video_notify: notifies the video connection state to user modules.
- */
-struct msm_ext_disp_intf_ops {
- int (*audio_config)(struct platform_device *pdev,
- enum msm_ext_disp_type type,
- enum msm_ext_disp_cable_state state);
-
- int (*audio_notify)(struct platform_device *pdev,
- enum msm_ext_disp_type type,
- enum msm_ext_disp_cable_state state);
-
-
- int (*video_notify)(struct platform_device *pdev,
- enum msm_ext_disp_type type,
- enum msm_ext_disp_cable_state state);
-};
-
-/**
- * struct msm_ext_disp_audio_codec_ops - operations exposed to audio codec
- * @audio_info_setup: configure audio on interface
- * @get_audio_edid_blk: retrieve audio edid block
- * @cable_status: cable connected/disconnected
- * @get_intf_id: id of connected interface
- * @teardown_done: audio session teardown done by qdsp
- * @acknowledge: acknowledge audio status received by user modules
- */
-struct msm_ext_disp_audio_codec_ops {
- int (*audio_info_setup)(struct platform_device *pdev,
- struct msm_ext_disp_audio_setup_params *params);
- int (*get_audio_edid_blk)(struct platform_device *pdev,
- struct msm_ext_disp_audio_edid_blk *blk);
- int (*cable_status)(struct platform_device *pdev, u32 vote);
- int (*get_intf_id)(struct platform_device *pdev);
- void (*teardown_done)(struct platform_device *pdev);
- int (*acknowledge)(struct platform_device *pdev, u32 ack);
-};
-
-/**
- * struct msm_ext_disp_init_data - data needed to register a display interface
- * @type: external display type
- * @intf_ops: external display interface operations
- * @codec_ops: audio codec operations
- * @pdev: platform device instance of the interface driver
- * @intf_data: interface specific data
- */
-struct msm_ext_disp_init_data {
- enum msm_ext_disp_type type;
- struct msm_ext_disp_intf_ops intf_ops;
- struct msm_ext_disp_audio_codec_ops codec_ops;
- struct platform_device *pdev;
- void *intf_data;
-};
-
-/**
- * struct msm_ext_disp_data - data needed by interface modules
- * @intf_pdev: platform device instance of the interface
- * @intf_data: data related to interface module
- */
-struct msm_ext_disp_data {
- struct platform_device *intf_pdev;
- void *intf_data;
-};
-
-/**
- * msm_ext_disp_register_audio_codec() - audio codec registration
- * @pdev: platform device pointer
- * @codec_ops: audio codec operations
- */
-int msm_ext_disp_register_audio_codec(struct platform_device *pdev,
- struct msm_ext_disp_audio_codec_ops *ops);
-
-/**
- * msm_hdmi_register_audio_codec() - wrapper for hdmi audio codec
- * registration
- * @pdev: platform device pointer
- * @codec_ops: audio codec operations
- */
-int msm_hdmi_register_audio_codec(struct platform_device *pdev,
- struct msm_ext_disp_audio_codec_ops *ops);
-
-/**
- * msm_ext_disp_register_intf() - display interface registration
- * @init_data: data needed to register the display interface
- */
-int msm_ext_disp_register_intf(struct platform_device *pdev,
- struct msm_ext_disp_init_data *init_data);
-
-#endif /*_MSM_EXT_DISPLAY_H_*/
@@ -273,63 +273,6 @@ struct drm_msm_submitqueue {
__u32 id; /* out, identifier */
};
-/* HDR WRGB x and y index */
-#define DISPLAY_PRIMARIES_WX 0
-#define DISPLAY_PRIMARIES_WY 1
-#define DISPLAY_PRIMARIES_RX 2
-#define DISPLAY_PRIMARIES_RY 3
-#define DISPLAY_PRIMARIES_GX 4
-#define DISPLAY_PRIMARIES_GY 5
-#define DISPLAY_PRIMARIES_BX 6
-#define DISPLAY_PRIMARIES_BY 7
-#define DISPLAY_PRIMARIES_MAX 8
-
-struct drm_panel_hdr_properties {
- __u32 hdr_enabled;
-
- /* WRGB X and y values arrayed in format */
- /* [WX, WY, RX, RY, GX, GY, BX, BY] */
- __u32 display_primaries[DISPLAY_PRIMARIES_MAX];
-
- /* peak brightness supported by panel */
- __u32 peak_brightness;
- /* Blackness level supported by panel */
- __u32 blackness_level;
-};
-
-/**
- * struct drm_msm_event_req - Payload to event enable/disable ioctls.
- * @object_id: DRM object id. e.g.: for crtc pass crtc id.
- * @object_type: DRM object type. e.g.: for crtc set it to DRM_MODE_OBJECT_CRTC.
- * @event: Event for which notification is being enabled/disabled.
- * e.g.: for Histogram set - DRM_EVENT_HISTOGRAM.
- * @client_context: Opaque pointer that will be returned during event response
- * notification.
- * @index: Object index(e.g.: crtc index), optional for user-space to set.
- * Driver will override value based on object_id and object_type.
- */
-struct drm_msm_event_req {
- __u32 object_id;
- __u32 object_type;
- __u32 event;
- __u64 client_context;
- __u32 index;
-};
-
-/**
- * struct drm_msm_event_resp - payload returned when read is called for
- * custom notifications.
- * @base: Event type and length of complete notification payload.
- * @info: Contains information about DRM that which raised this event.
- * @data: Custom payload that driver returns for event type.
- * size of data = base.length - (sizeof(base) + sizeof(info))
- */
-struct drm_msm_event_resp {
- struct drm_event base;
- struct drm_msm_event_req info;
- __u8 data[];
-};
-
#define DRM_MSM_GET_PARAM 0x00
/* placeholder:
#define DRM_MSM_SET_PARAM 0x01
@@ -347,19 +290,6 @@ struct drm_msm_event_resp {
#define DRM_MSM_SUBMITQUEUE_NEW 0x0A
#define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B
-#define DRM_DPU_WB_CONFIG 0x40
-#define DRM_MSM_REGISTER_EVENT 0x41
-#define DRM_MSM_DEREGISTER_EVENT 0x42
-#define DRM_MSM_RMFB2 0x43
-
-/* dpu custom events */
-#define DRM_EVENT_HISTOGRAM 0x80000000
-#define DRM_EVENT_AD_BACKLIGHT 0x80000001
-#define DRM_EVENT_CRTC_POWER 0x80000002
-#define DRM_EVENT_SYS_BACKLIGHT 0x80000003
-#define DRM_EVENT_DPU_POWER 0x80000004
-#define DRM_EVENT_IDLE_NOTIFY 0x80000005
-
#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
@@ -370,14 +300,6 @@ struct drm_msm_event_resp {
#define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
-#define DRM_IOCTL_DPU_WB_CONFIG \
- DRM_IOW((DRM_COMMAND_BASE + DRM_DPU_WB_CONFIG), struct dpu_drm_wb_cfg)
-#define DRM_IOCTL_MSM_REGISTER_EVENT DRM_IOW((DRM_COMMAND_BASE + \
- DRM_MSM_REGISTER_EVENT), struct drm_msm_event_req)
-#define DRM_IOCTL_MSM_DEREGISTER_EVENT DRM_IOW((DRM_COMMAND_BASE + \
- DRM_MSM_DEREGISTER_EVENT), struct drm_msm_event_req)
-#define DRM_IOCTL_MSM_RMFB2 DRM_IOW((DRM_COMMAND_BASE + \
- DRM_MSM_RMFB2), unsigned int)
#if defined(__cplusplus)
}
This patch is removing a bunch more dpu changes that touch msm core. Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: I1c82454ad372b34ca5b0d6db2af1b513a5ba2fe1 --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 77 +------ drivers/gpu/drm/msm/msm_atomic.c | 3 +- drivers/gpu/drm/msm/msm_drv.c | 246 ++--------------------- drivers/gpu/drm/msm/msm_drv.h | 154 +------------- drivers/gpu/drm/msm/msm_kms.h | 8 +- drivers/gpu/drm/msm/msm_rd.c | 55 +---- include/drm/drm_mipi_dsi.h | 4 - include/linux/msm_ext_display.h | 182 ----------------- include/uapi/drm/msm_drm.h | 78 ------- 9 files changed, 47 insertions(+), 760 deletions(-) delete mode 100644 include/linux/msm_ext_display.h