Commit d62bef10 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next

things are still slow in etnaviv land, so we don't have anything major
to destage. Just a couple of non-critical fixes that I want to land in
5.2.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1556874643.2590.15.camel@pengutronix.de
parents 42244923 2b76f5be
...@@ -514,6 +514,9 @@ static int etnaviv_bind(struct device *dev) ...@@ -514,6 +514,9 @@ static int etnaviv_bind(struct device *dev)
} }
drm->dev_private = priv; drm->dev_private = priv;
dev->dma_parms = &priv->dma_parms;
dma_set_max_seg_size(dev, SZ_2G);
mutex_init(&priv->gem_lock); mutex_init(&priv->gem_lock);
INIT_LIST_HEAD(&priv->gem_list); INIT_LIST_HEAD(&priv->gem_list);
priv->num_gpus = 0; priv->num_gpus = 0;
...@@ -551,6 +554,8 @@ static void etnaviv_unbind(struct device *dev) ...@@ -551,6 +554,8 @@ static void etnaviv_unbind(struct device *dev)
component_unbind_all(dev, drm); component_unbind_all(dev, drm);
dev->dma_parms = NULL;
drm->dev_private = NULL; drm->dev_private = NULL;
kfree(priv); kfree(priv);
......
...@@ -42,6 +42,7 @@ struct etnaviv_file_private { ...@@ -42,6 +42,7 @@ struct etnaviv_file_private {
struct etnaviv_drm_private { struct etnaviv_drm_private {
int num_gpus; int num_gpus;
struct device_dma_parameters dma_parms;
struct etnaviv_gpu *gpu[ETNA_MAX_PIPES]; struct etnaviv_gpu *gpu[ETNA_MAX_PIPES];
/* list of GEM objects: */ /* list of GEM objects: */
......
...@@ -622,24 +622,18 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file, ...@@ -622,24 +622,18 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file,
lockdep_set_class(&to_etnaviv_bo(obj)->lock, &etnaviv_shm_lock_class); lockdep_set_class(&to_etnaviv_bo(obj)->lock, &etnaviv_shm_lock_class);
ret = drm_gem_object_init(dev, obj, size); ret = drm_gem_object_init(dev, obj, size);
if (ret == 0) {
struct address_space *mapping;
/*
* Our buffers are kept pinned, so allocating them
* from the MOVABLE zone is a really bad idea, and
* conflicts with CMA. See comments above new_inode()
* why this is required _and_ expected if you're
* going to pin these pages.
*/
mapping = obj->filp->f_mapping;
mapping_set_gfp_mask(mapping, GFP_HIGHUSER |
__GFP_RETRY_MAYFAIL | __GFP_NOWARN);
}
if (ret) if (ret)
goto fail; goto fail;
/*
* Our buffers are kept pinned, so allocating them from the MOVABLE
* zone is a really bad idea, and conflicts with CMA. See comments
* above new_inode() why this is required _and_ expected if you're
* going to pin these pages.
*/
mapping_set_gfp_mask(obj->filp->f_mapping, GFP_HIGHUSER |
__GFP_RETRY_MAYFAIL | __GFP_NOWARN);
etnaviv_gem_obj_add(dev, obj); etnaviv_gem_obj_add(dev, obj);
ret = drm_gem_handle_create(file, obj, handle); ret = drm_gem_handle_create(file, obj, handle);
......
...@@ -365,6 +365,7 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu) ...@@ -365,6 +365,7 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu)
dev_info(gpu->dev, "model: GC%x, revision: %x\n", dev_info(gpu->dev, "model: GC%x, revision: %x\n",
gpu->identity.model, gpu->identity.revision); gpu->identity.model, gpu->identity.revision);
gpu->idle_mask = ~VIVS_HI_IDLE_STATE_AXI_LP;
/* /*
* If there is a match in the HWDB, we aren't interested in the * If there is a match in the HWDB, we aren't interested in the
* remaining register values, as they might be wrong. * remaining register values, as they might be wrong.
...@@ -412,7 +413,7 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu) ...@@ -412,7 +413,7 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu)
} }
/* GC600 idle register reports zero bits where modules aren't present */ /* GC600 idle register reports zero bits where modules aren't present */
if (gpu->identity.model == chipModel_GC600) { if (gpu->identity.model == chipModel_GC600)
gpu->idle_mask = VIVS_HI_IDLE_STATE_TX | gpu->idle_mask = VIVS_HI_IDLE_STATE_TX |
VIVS_HI_IDLE_STATE_RA | VIVS_HI_IDLE_STATE_RA |
VIVS_HI_IDLE_STATE_SE | VIVS_HI_IDLE_STATE_SE |
...@@ -421,9 +422,6 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu) ...@@ -421,9 +422,6 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu)
VIVS_HI_IDLE_STATE_PE | VIVS_HI_IDLE_STATE_PE |
VIVS_HI_IDLE_STATE_DE | VIVS_HI_IDLE_STATE_DE |
VIVS_HI_IDLE_STATE_FE; VIVS_HI_IDLE_STATE_FE;
} else {
gpu->idle_mask = ~VIVS_HI_IDLE_STATE_AXI_LP;
}
etnaviv_hw_specs(gpu); etnaviv_hw_specs(gpu);
} }
......
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