updated exynos-drm-fixes
Subsystems (3)
Inki Dae
maintainercover updated exynos-drm-fixes
Hello all,
This patch set fixes the following:
. fixed page align
- page align is done by exynos_drm_gem_create() so do not align in page unit at exynos_drm_gem_dumb_create().
. removed unnecessary dpms call
- encoder's mode_set callback isn't specific to hardware so it doesn't need to call exynos_drm_encoder_dpms()
. control display power at connector module
- it doesn't need that display power is controlled by encoder's dpms so moves it into connector module so that the display power can be controlled by connector's dpms properly.
. make sure that hardware overlay for fimd and hdmi is disabled
- the values set to registers will be updated into real registers at vsync so dma operation could be malfunctioned when accessed to memory after gem buffer was released. this patch makes sure that hw overlay is disabled before the gem buffer is released.
. check NV12M format specific to Exynos properly
- this patch adds buf_cnt variable in exynos_drm_fb structure and that means a buffer count to drm framebuffer and also adds two functions to get/set the buffer count from/to exynos_drm_fb structure. if pixel format is not DRM_FORMAT_NV12MT then it gets a buffer count to drm framebuffer refering to mode_cmd->handles and offsets. but when booted, the buffer count will always be 1 because pixel format of console framebuffer is RGB format.
. updated crtc to plane safely
- if old_crtc isn't same as encoder->crtc then it means that user changed crtc id to another one so a plane to old_crtc should be disabled so that current plane can be updated safely and plane->crtc should be set to new crtc(encoder->crtc)
And code clean like below:
. separated fimd_power_on into some parts
- separated fimd_power_on into fimd_activate and fimd_clock functions and fimd_activate function will call fimd_clock to control fimd power and vsync interrupt.
. separated subdrv->probe call and encoder/connector creation
- with this patch, exynos drm core module can take exception when some operation was failed properly.
. changed context name of hdmi and mixer
- changed ctx variable name in exynos_drm_hdmi_context structure to client because the use of ctx variable name makes it confused.
. fixed build warning
Thanks.
Inki Dae (13):
drm/exynos: added device object to subdrv's remove callback as
argument
drm/exynos: separated subdrv->probe call and encoder/connector
creation.
drm/exynos: fixed page align bug.
drm/exynos: use empty function instead of drm_helper_connector_dpms drm/exynos: removed exynos_drm_encoder_dpms call drm/exynos: separeated fimd_power_on into some parts. drm/exynos: control display power at connector module. drm/exynos: make sure that hardware overlay for fimd is disabled drm/exynos: check NV12M format specific to Exynos properly drm/exynos: update crtc to plane safely
drm/exynos: changed context name of hdmi and mixer drm/exynos: fixed build warning
drm/exynos: make sure that hardware overlay for hdmi is disabled
drivers/gpu/drm/exynos/exynos_drm_connector.c | 18 +++++- drivers/gpu/drm/exynos/exynos_drm_core.c | 93 +++++++++++++++++-------- drivers/gpu/drm/exynos/exynos_drm_drv.h | 19 +++++- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 92 +++++++++++++++++------- drivers/gpu/drm/exynos/exynos_drm_fb.c | 65 ++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_fb.h | 20 ++---- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 + drivers/gpu/drm/exynos/exynos_drm_fimd.c | 74 ++++++++++++++------ drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 47 ++++++++----- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 5 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++-- drivers/gpu/drm/exynos/exynos_mixer.c | 21 +++++- 15 files changed, 349 insertions(+), 126 deletions(-)
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 1/13 drm/exynos: added device object to subdrv's remove callback as argument
when remove callback of exynos_drm_subdrv is called, it could need device object for sub driver to control things specific to hw such as runtime pm.
--- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 +- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.h +1 -1
@@ -266,7 +266,7 @@ struct exynos_drm_subdrv {struct exynos_drm_manager *manager;int (*probe)(struct drm_device *drm_dev,struct device *dev); -void (*remove)(struct drm_device *dev); +void (*remove)(struct drm_device *drm_dev,struct device *dev);int (*open)(struct drm_device *drm_dev,struct device *dev,struct drm_file *file); void (*close)(struct drm_device *drm_dev, struct device *dev,
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
@@ -678,7 +678,7 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev)return 0 ; } -static void fimd_subdrv_remove (struct drm_device *drm_dev) +static void fimd_subdrv_remove (struct drm_device *drm_dev,struct device *dev) {DRM_DEBUG_KMS ("%s\n" , __FILE__);
drivers/gpu/drm/exynos/exynos_drm_vidi.c +1 -1
@@ -466,7 +466,7 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)return 0 ; } -static void vidi_subdrv_remove (struct drm_device *drm_dev) +static void vidi_subdrv_remove (struct drm_device *drm_dev,struct device *dev) {DRM_DEBUG_KMS ("%s\n" , __FILE__);
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 2/13 drm/exynos: separated subdrv->probe call and encoder/connector creation.
In reply to Inki Daethis patch separates sub driver's probe call and encoder/connector creation so that exynos drm core module can take exception when some operation was failed properly.
--- drivers/gpu/drm/exynos/exynos_drm_core.c | 93 +++++++++++++++++++++--------- 1 files changed, 65 insertions(+), 28 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_core.c +65 -28
@@ -34,30 +34,15 @@static LIST_HEAD (exynos_drm_subdrv_list); -static int exynos_drm_subdrv_probe (struct drm_device *dev, +static int exynos_drm_create_enc_conn (struct drm_device *dev,struct exynos_drm_subdrv *subdrv) {struct drm_encoder *encoder;struct drm_connector *connector; +int ret;DRM_DEBUG_DRIVER ("%s\n" , __FILE__); -if (subdrv->probe) { -int ret; - -/* -* this probe callback would be called by sub driver -* after setting of all resources to this sub driver, -* such as clock, irq and register map are done or by load() -* of exynos drm driver. -* -* P.S. note that this driver is considered for modularization. -*/ - ret = subdrv->probe (dev, subdrv->dev); -if (ret) -return ret; - } -if (!subdrv->manager)return 0 ;
@@ -78,24 +63,22 @@ static int exynos_drm_subdrv_probe(struct drm_device *dev, connector =exynos_drm_connector_create (dev, encoder);if (!connector) {DRM_ERROR ("failed to create connector\n" ); - encoder->funcs->destroy (encoder); -return -EFAULT ; + ret = -EFAULT ; + goto err_destroy_encoder; } subdrv->encoder = encoder; subdrv->connector = connector;return 0 ; + +err_destroy_encoder: + encoder->funcs->destroy (encoder); +return ret; } -static void exynos_drm_subdrv_remove (struct drm_device *dev, -struct exynos_drm_subdrv *subdrv) +static void exynos_drm_destroy_enc_conn (struct exynos_drm_subdrv *subdrv) { -DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - -if (subdrv->remove) - subdrv->remove (dev); -if (subdrv->encoder) {struct drm_encoder *encoder = subdrv->encoder; encoder->funcs->destroy (encoder);
@@ -109,9 +92,48 @@ static void exynos_drm_subdrv_remove(struct drm_device *dev, } } +static int exynos_drm_subdrv_probe (struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +if (subdrv->probe) { +int ret; + + subdrv->drm_dev = dev; + +/* +* this probe callback would be called by sub driver +* after setting of all resources to this sub driver, +* such as clock, irq and register map are done or by load() +* of exynos drm driver. +* +* P.S. note that this driver is considered for modularization. +*/ + ret = subdrv->probe (dev, subdrv->dev); +if (ret) +return ret; + } + +if (!subdrv->manager) +return -EINVAL ; + + subdrv->manager->dev = subdrv->dev; + +return 0 ; +} + +static void exynos_drm_subdrv_remove (struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + +if (subdrv->remove) + subdrv->remove (dev, subdrv->dev); +} +int exynos_drm_device_register (struct drm_device *dev) {struct exynos_drm_subdrv *subdrv, *n; +unsigned int fine_cnt =0 ;int err;DRM_DEBUG_DRIVER ("%s\n" , __FILE__);
@@ -120,14 +142,27 @@ int exynos_drm_device_register(struct drm_device *dev)return -EINVAL ;list_for_each_entry_safe (subdrv, n, &exynos_drm_subdrv_list, list) { - subdrv->drm_dev = dev; err =exynos_drm_subdrv_probe (dev, subdrv);if (err) {DRM_DEBUG ("exynos drm subdrv probe failed.\n" );list_del (&subdrv->list); +continue ; } + + err =exynos_drm_create_enc_conn (dev, subdrv); +if (err) { +DRM_DEBUG ("failed to create encoder and connector.\n" ); +exynos_drm_subdrv_remove (dev, subdrv); +list_del (&subdrv->list); +continue ; + } + + fine_cnt++; } +if (!fine_cnt) +return -EINVAL ; +return 0 ; }EXPORT_SYMBOL_GPL (exynos_drm_device_register);
@@ -143,8 +178,10 @@ int exynos_drm_device_unregister(struct drm_device *dev)return -EINVAL ; } -list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) +list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) {exynos_drm_subdrv_remove (dev, subdrv); +exynos_drm_destroy_enc_conn (subdrv); + }return 0 ; }
Signature · 1 line
1.7.4.1
Re: [PATCH 02/13] drm/exynos: separated subdrv->probe call and encoder/connector creation.
Quoted 3 lines · Inki Dae
this patch separates sub driver's probe call and encoder/connector creation so that exynos drm core module can take exception when some operation was failed properly.
Which exceptions? I don't know this patch gives any benefit to us.
Quoted 166 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_core.c | 93 +++++++++++++++++++++--------- 1 files changed, 65 insertions(+), 28 deletions(-)drivers/gpu/drm/exynos/exynos_drm_core.c +65
-28@@ -34,30 +34,15 @@static LIST_HEAD (exynos_drm_subdrv_list); -static int exynos_drm_subdrv_probe (struct drm_device *dev, +static int exynos_drm_create_enc_conn (struct drm_device *dev,struct exynos_drm_subdrv *subdrv) {struct drm_encoder *encoder;struct drm_connector *connector; +int ret;DRM_DEBUG_DRIVER ("%s\n" , __FILE__); -if (subdrv->probe) { -int ret; - -/* -* this probe callback would be called by sub driver -* after setting of all resources to this sub driver, -* such as clock, irq and register map are done or by load() -* of exynos drm driver. -* -* P.S. note that this driver is considered for modularization. -*/ - ret = subdrv->probe (dev, subdrv->dev); -if (ret) -return ret; - } -if (!subdrv->manager)return 0 ;@@ -78,24 +63,22 @@ static int exynos_drm_subdrv_probe(struct drm_device *dev, connector =exynos_drm_connector_create (dev, encoder);if (!connector) {DRM_ERROR ("failed to create connector\n" ); - encoder->funcs->destroy (encoder); -return -EFAULT ; + ret = -EFAULT ; + goto err_destroy_encoder; } subdrv->encoder = encoder; subdrv->connector = connector;return 0 ; + +err_destroy_encoder: + encoder->funcs->destroy (encoder); +return ret; } -static void exynos_drm_subdrv_remove (struct drm_device *dev, -struct exynos_drm_subdrv *subdrv) +static void exynos_drm_destroy_enc_conn (struct exynos_drm_subdrv *subdrv) { -DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - -if (subdrv->remove) - subdrv->remove (dev); -if (subdrv->encoder) {struct drm_encoder *encoder = subdrv->encoder; encoder->funcs->destroy (encoder);@@ -109,9 +92,48 @@ static void exynos_drm_subdrv_remove(struct drm_device *dev, } } +static int exynos_drm_subdrv_probe (struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +if (subdrv->probe) { +int ret; + + subdrv->drm_dev = dev; + +/* +* this probe callback would be called by sub driver +* after setting of all resources to this sub driver, +* such as clock, irq and register map are done or by load() +* of exynos drm driver. +* +* P.S. note that this driver is considered for modularization. +*/ + ret = subdrv->probe (dev, subdrv->dev); +if (ret) +return ret; + } + +if (!subdrv->manager) +return -EINVAL ; + + subdrv->manager->dev = subdrv->dev; + +return 0 ; +} + +static void exynos_drm_subdrv_remove (struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + +if (subdrv->remove) + subdrv->remove (dev, subdrv->dev); +} +int exynos_drm_device_register (struct drm_device *dev) {struct exynos_drm_subdrv *subdrv, *n; +unsigned int fine_cnt =0 ;int err;DRM_DEBUG_DRIVER ("%s\n" , __FILE__);@@ -120,14 +142,27 @@ int exynos_drm_device_register(struct drm_device *dev)return -EINVAL ;list_for_each_entry_safe (subdrv, n, &exynos_drm_subdrv_list, list) { - subdrv->drm_dev = dev; err =exynos_drm_subdrv_probe (dev, subdrv);if (err) {DRM_DEBUG ("exynos drm subdrv probe failed.\n" );list_del (&subdrv->list); +continue ; } + + err =exynos_drm_create_enc_conn (dev, subdrv); +if (err) { +DRM_DEBUG ("failed to create encoder and connector.\n" ); +exynos_drm_subdrv_remove (dev, subdrv); +list_del (&subdrv->list); +continue ; + } + + fine_cnt++; } +if (!fine_cnt) +return -EINVAL ; +return 0 ; }EXPORT_SYMBOL_GPL (exynos_drm_device_register);@@ -143,8 +178,10 @@ int exynos_drm_device_unregister(struct drm_device *dev)return -EINVAL ; } -list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) +list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) {exynos_drm_subdrv_remove (dev, subdrv); +exynos_drm_destroy_enc_conn (subdrv); + }return 0 ; }
InKi Dae
maintainerRe: [PATCH 02/13] drm/exynos: separated subdrv->probe call and encoder/connector creation.
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 10 lines · Inki Dae
Quoted 5 lines
this patch separates sub driver's probe call and encoder/connector creation
so that exynos drm core module can take exception when some operation was failed properly.Which exceptions? I don't know this patch gives any benefit to us.
previous code didn't take exception when exynos_drm_encoder_create() is falied. and for now, exynos_drm_encoder/connector_create functions was called at exynos_drm_subdrv_probe() so know that this patch is for code clean by separating them into two parts also.
Quoted 171 lines
Quoted 155 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_core.c | 93 +++++++++++++++++++++--------- 1 files changed, 65 insertions(+), 28 deletions(-)drivers/gpu/drm/exynos/exynos_drm_core.c +2
-9@@ -34,30 +34,15 @@static LIST_HEAD (exynos_drm_subdrv_list); -static int exynos_drm_subdrv_probe(struct drm_device *dev, +static int exynos_drm_create_enc_conn (struct drm_device *dev, struct exynos_drm_subdrv *subdrv) {struct drm_encoder *encoder;struct drm_connector *connector; +int ret;DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - if (subdrv->probe) { -int ret; - -/* -* this probe callback would be called by sub driver -* after setting of all resources to this sub driver, -* such as clock, irq and register map are done or by load () -* of exynos drm driver. -* -* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +0
-6-*/ - ret = subdrv->probe (dev, subdrv->dev); -if (ret) -return ret; - } -if (!subdrv->manager)return 0 ; @@ -78,24 +63,22 @@ static int exynos_drm_subdrv_probe(struct drm_device*dev,
connector = exynos_drm_connector_create(dev, encoder); if (!connector) { DRM_ERROR("failed to create connector\n");drivers/gpu/drm/exynos/exynos_drm_core.c +21
-8- encoder->funcs->destroy (encoder); -return -EFAULT ; + ret = -EFAULT ; + goto err_destroy_encoder; } subdrv->encoder = encoder; subdrv->connector = connector;return 0 ; + +err_destroy_encoder: + encoder->funcs->destroy (encoder); +return ret; } -static void exynos_drm_subdrv_remove(struct drm_device *dev, -struct exynos_drm_subdrv *subdrv) +static void exynos_drm_destroy_enc_conn(struct exynos_drm_subdrv *subdrv) { -DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - -if (subdrv->remove) - subdrv->remove (dev); -if (subdrv->encoder) {struct drm_encoder *encoder = subdrv->encoder; encoder->funcs->destroy (encoder);@@ -109,9 +92,48 @@ static void exynos_drm_subdrv_remove(struct drm_device *dev, } } +static int exynos_drm_subdrv_probe(struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +if (subdrv->probe) { +int ret; + + subdrv->drm_dev = dev; + +/* +* this probe callback would be called by sub driver +* after setting of all resources to this sub driver, +* such as clock, irq and register map are done or by load() +* of exynos drm driver. +* +* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +37
-1+*/ + ret = subdrv->probe (dev, subdrv->dev); +if (ret) +return ret; + } + +if (!subdrv->manager) +return -EINVAL ; + + subdrv->manager->dev = subdrv->dev; + +return 0 ; +} + +static void exynos_drm_subdrv_remove (struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + +if (subdrv->remove) + subdrv->remove (dev, subdrv->dev); +} +int exynos_drm_device_register (struct drm_device *dev) {struct exynos_drm_subdrv *subdrv, *n; +unsigned int fine_cnt =0 ;int err;DRM_DEBUG_DRIVER ("%s\n" , __FILE__);@@ -120,14 +142,27 @@ int exynos_drm_device_register(struct drm_device *dev)return -EINVAL ;list_for_each_entry_safe (subdrv, n, &exynos_drm_subdrv_list, list) { - subdrv->drm_dev = dev; err =exynos_drm_subdrv_probe (dev, subdrv);if (err) {DRM_DEBUG ("exynos drm subdrv probe failed.\n" );list_del (&subdrv->list); +continue ; } + + err =exynos_drm_create_enc_conn (dev, subdrv); +if (err) { + DRM_DEBUG("failed to create encoder and connector.\n"); +exynos_drm_subdrv_remove (dev, subdrv); +list_del (&subdrv->list); +continue ; + } + + fine_cnt++; } + if (!fine_cnt) + return -EINVAL; +return 0 ; }EXPORT_SYMBOL_GPL (exynos_drm_device_register);drivers/gpu/drm/exynos/exynos_drm_core.c int exynos_drm_device_unregister(struct drm_device · line 187
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_core.c +3
-0@@ -143,8 +178,10 @@ int exynos_drm_device_unregister(struct drm_device *dev)return -EINVAL ; } - list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) +list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) {exynos_drm_subdrv_remove (dev, subdrv); +exynos_drm_destroy_enc_conn (subdrv); + }return 0 ; }_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/13] drm/exynos: separated subdrv->probe call and encoder/connector creation.
Quoted 11 lines · InKi Dae
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 8 lines · Inki Dae
Quoted 4 lines
this patch separates sub driver's probe call and encoder/connector creation
so that exynos drm core module can take exception when some operation was failed properly.Which exceptions? I don't know this patch gives any benefit to us.
previous code didn't take exception when
exynos_drm_encoder_create()is falied.
No, it is considered.
Quoted 3 lines
and for now, exynos_drm_encoder/connector_create functions was called at
exynos_drm_subdrv_probe()so know that this patch is for code clean by separating them into two parts also.
It's ok, but it just splitting.
Quoted 169 lines
Quoted 169 lines
Quoted 154 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_core.c | 93 +++++++++++++++++++++--------- 1 files changed, 65 insertions(+), 28 deletions(-)drivers/gpu/drm/exynos/exynos_drm_core.c +2
-9@@ -34,30 +34,15 @@static LIST_HEAD (exynos_drm_subdrv_list); -static int exynos_drm_subdrv_probe(struct drm_device *dev, +static int exynos_drm_create_enc_conn (struct drm_device *dev, struct exynos_drm_subdrv *subdrv) {struct drm_encoder *encoder;struct drm_connector *connector; +int ret;DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - if (subdrv->probe) { -int ret; - -/* -* this probe callback would be called by sub driver -* after setting of all resources to this sub driver, -* such as clock, irq and register map are done or by load () -* of exynos drm driver. -* -* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +0
-6-*/ - ret = subdrv->probe (dev, subdrv->dev); -if (ret) -return ret; - } -if (!subdrv->manager)return 0 ; @@ -78,24 +63,22 @@ static int exynos_drm_subdrv_probe(struct drm_device*dev,
connector = exynos_drm_connector_create(dev, encoder); if (!connector) { DRM_ERROR("failed to create connector\n");drivers/gpu/drm/exynos/exynos_drm_core.c +21
-8- encoder->funcs->destroy (encoder); -return -EFAULT ; + ret = -EFAULT ; + goto err_destroy_encoder; } subdrv->encoder = encoder; subdrv->connector = connector;return 0 ; + +err_destroy_encoder: + encoder->funcs->destroy (encoder); +return ret; } -static void exynos_drm_subdrv_remove(struct drm_device *dev, -struct exynos_drm_subdrv *subdrv) +static void exynos_drm_destroy_enc_conn(struct exynos_drm_subdrv *subdrv) { -DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - -if (subdrv->remove) - subdrv->remove (dev); -if (subdrv->encoder) {struct drm_encoder *encoder = subdrv->encoder; encoder->funcs->destroy (encoder);@@ -109,9 +92,48 @@ static void exynos_drm_subdrv_remove(struct drm_device *dev, } } +static int exynos_drm_subdrv_probe(struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +if (subdrv->probe) { +int ret; + + subdrv->drm_dev = dev; + +/* +* this probe callback would be called by sub driver +* after setting of all resources to this sub driver, +* such as clock, irq and register map are done or by load() +* of exynos drm driver. +* +* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +37
-1+*/ + ret = subdrv->probe (dev, subdrv->dev); +if (ret) +return ret; + } + +if (!subdrv->manager) +return -EINVAL ; + + subdrv->manager->dev = subdrv->dev; + +return 0 ; +} + +static void exynos_drm_subdrv_remove (struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + +if (subdrv->remove) + subdrv->remove (dev, subdrv->dev); +} +int exynos_drm_device_register (struct drm_device *dev) {struct exynos_drm_subdrv *subdrv, *n; +unsigned int fine_cnt =0 ;int err;DRM_DEBUG_DRIVER ("%s\n" , __FILE__);@@ -120,14 +142,27 @@ int exynos_drm_device_register(struct drm_device *dev)return -EINVAL ;list_for_each_entry_safe (subdrv, n, &exynos_drm_subdrv_list, list) { - subdrv->drm_dev = dev; err =exynos_drm_subdrv_probe (dev, subdrv);if (err) {DRM_DEBUG ("exynos drm subdrv probe failed.\n" );list_del (&subdrv->list); +continue ; } + + err =exynos_drm_create_enc_conn (dev, subdrv); +if (err) { + DRM_DEBUG("failed to create encoder and connector.\n"); +exynos_drm_subdrv_remove (dev, subdrv); +list_del (&subdrv->list); +continue ; + } + + fine_cnt++; } + if (!fine_cnt) + return -EINVAL; +return 0 ; }EXPORT_SYMBOL_GPL (exynos_drm_device_register);drivers/gpu/drm/exynos/exynos_drm_core.c int exynos_drm_device_unregister(struct drm_device · line 187
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_core.c +3
-0@@ -143,8 +178,10 @@ int exynos_drm_device_unregister(struct drm_device *dev)return -EINVAL ; } - list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) +list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) {exynos_drm_subdrv_remove (dev, subdrv); +exynos_drm_destroy_enc_conn (subdrv); + }return 0 ; }_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
InKi Dae
maintainerRe: [PATCH 02/13] drm/exynos: separated subdrv->probe call and encoder/connector creation.
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 13 lines · InKi Dae
Quoted 12 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 10 lines · Inki Dae
Quoted 6 lines
this patch separates sub driver's probe call and encoder/connector creation
so that exynos drm core module can take exception when some operation was
failed properly.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Which exceptions? I don't know this patch gives any benefit to us.
previous code didn't take exception when
exynos_drm_encoder_create()is falied.No, it is considered.
where is subdrv->remove() called when exynos_drm_encoder_create() is failed? I think if failed then subdrv->remove() should be called and if exynos_drm_connector_create() is failed then not only encoder->funcs->destory() but also subdrv->remove()
Quoted 191 lines
Quoted 4 lines
and for now, exynos_drm_encoder/connector_create functions was called at
exynos_drm_subdrv_probe()so know that this patch is for code clean by separating them into two parts also.It's ok, but it just splitting.
Quoted 168 lines
Quoted 168 lines
Quoted 168 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_core.c | 93 +++++++++++++++++++++--------- 1 files changed, 65 insertions(+), 28 deletions(-)drivers/gpu/drm/exynos/exynos_drm_core.c +2
-9@@ -34,30 +34,15 @@static LIST_HEAD (exynos_drm_subdrv_list); -static int exynos_drm_subdrv_probe(struct drm_device *dev, +static int exynos_drm_create_enc_conn (struct drm_device *dev,struct exynos_drm_subdrv *subdrv) {struct drm_encoder *encoder;struct drm_connector *connector; +int ret;DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - if (subdrv->probe) { -int ret; - -/* -* this probe callback would be called by sub driver -* after setting of all resources to this sub driver, -* such as clock, irq and register map are done or by load () -* of exynos drm driver. -* -* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +0
-6-*/ - ret = subdrv->probe (dev, subdrv->dev); -if (ret) -return ret; - } -if (!subdrv->manager)return 0 ; @@ -78,24 +63,22 @@ static int exynos_drm_subdrv_probe(struct
drm_device
*dev,connector = exynos_drm_connector_create(dev, encoder); if (!connector) { DRM_ERROR("failed to create connector\n");drivers/gpu/drm/exynos/exynos_drm_core.c +7
-3- encoder->funcs->destroy (encoder); -return -EFAULT ; + ret = -EFAULT ; + goto err_destroy_encoder; } subdrv->encoder = encoder; subdrv->connector = connector;return 0 ; + +err_destroy_encoder: + encoder->funcs->destroy (encoder); +return ret; } -static void exynos_drm_subdrv_remove(struct drm_device *dev, -struct exynos_drm_subdrv *subdrv) +static void exynos_drm_destroy_enc_conn(struct exynos_drm_subdrv*subdrv)
{drivers/gpu/drm/exynos/exynos_drm_core.c +0
-5-DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - -if (subdrv->remove) - subdrv->remove (dev); -if (subdrv->encoder) {struct drm_encoder *encoder = subdrv->encoder; encoder->funcs->destroy (encoder);@@ -109,9 +92,48 @@ static void exynos_drm_subdrv_remove(struct
drm_device
*dev,}}
+static int exynos_drm_subdrv_probe(structdrm_device*dev,
+ structexynos_drm_subdrv
*subdrv)drivers/gpu/drm/exynos/exynos_drm_core.c +10
-0+{ +if (subdrv->probe) { +int ret; + + subdrv->drm_dev = dev; + +/* +* this probe callback would be called by sub driver +* after setting of all resources to this sub driver, +* such as clock, irq and register map are done or by
load()drivers/gpu/drm/exynos/exynos_drm_core.c +3
-0+* of exynos drm driver. +* +* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +40
-1+*/ + ret = subdrv->probe (dev, subdrv->dev); +if (ret) +return ret; + } + +if (!subdrv->manager) +return -EINVAL ; + + subdrv->manager->dev = subdrv->dev; + +return 0 ; +} + +static void exynos_drm_subdrv_remove (struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + +if (subdrv->remove) + subdrv->remove (dev, subdrv->dev); +} +int exynos_drm_device_register (struct drm_device *dev) {struct exynos_drm_subdrv *subdrv, *n; +unsigned int fine_cnt =0 ;int err;DRM_DEBUG_DRIVER ("%s\n" , __FILE__);@@ -120,14 +142,27 @@ int exynos_drm_device_register(struct drm_device *dev)return -EINVAL ;list_for_each_entry_safe (subdrv, n, &exynos_drm_subdrv_list, list) { - subdrv->drm_dev = dev; err =exynos_drm_subdrv_probe (dev, subdrv);if (err) {DRM_DEBUG ("exynos drm subdrv probe failed.\n" );list_del (&subdrv->list); +continue ; } + + err =exynos_drm_create_enc_conn (dev, subdrv); +if (err) { + DRM_DEBUG("failed to create encoder and connector.\n"); +exynos_drm_subdrv_remove (dev, subdrv); +list_del (&subdrv->list); +continue ; + } + + fine_cnt++; } + if (!fine_cnt) + return -EINVAL; +return 0 ; }EXPORT_SYMBOL_GPL (exynos_drm_device_register);@@ -143,8 +178,10 @@ int exynos_drm_device_unregister(struct drm_device *dev)return -EINVAL ; } - list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) +list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) {exynos_drm_subdrv_remove (dev, subdrv); +exynos_drm_destroy_enc_conn (subdrv); + }Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_core.c int exynos_drm_device_unregister(struct drm_device · line 187
Quoted 2 lines
drivers/gpu/drm/exynos/exynos_drm_core.c +0
-0return 0 ; }_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/13] drm/exynos: separated subdrv->probe call and encoder/connector creation.
Quoted 15 lines · InKi Dae
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 14 lines · InKi Dae
Quoted 12 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 9 lines · Inki Dae
Quoted 5 lines
this patch separates sub driver's probe call and encoder/connector creation
so that exynos drm core module can take exception when some operation was
failed properly.Which exceptions? I don't know this patch gives any benefit to us.
previous code didn't take exception when
exynos_drm_encoder_create()is falied.
Quoted 6 lines
Quoted 2 lines
No, it is considered.
where is
subdrv->remove()called whenexynos_drm_encoder_create()is failed? I think if failed thensubdrv->remove()should be called and ifexynos_drm_connector_create()is failed then not onlyencoder->funcs->destory()but alsosubdrv->remove()
OK, but just add subdrv->remove(). Then if it needs, please split function.
Quoted 186 lines
Quoted 186 lines
Quoted 3 lines
and for now, exynos_drm_encoder/connector_create functions was called at
exynos_drm_subdrv_probe()so know that this patch is for code clean by separating them into two parts also.It's ok, but it just splitting.
Quoted 166 lines
Quoted 166 lines
Quoted 166 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_core.c | 93 +++++++++++++++++++++--------- 1 files changed, 65 insertions(+), 28 deletions(-)drivers/gpu/drm/exynos/exynos_drm_core.c +2
-9@@ -34,30 +34,15 @@static LIST_HEAD (exynos_drm_subdrv_list); -static int exynos_drm_subdrv_probe(struct drm_device *dev, +static int exynos_drm_create_enc_conn (struct drm_device *dev,struct exynos_drm_subdrv *subdrv) {struct drm_encoder *encoder;struct drm_connector *connector; +int ret;DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - if (subdrv->probe) { -int ret; - -/* -* this probe callback would be called by sub driver -* after setting of all resources to this sub driver, -* such as clock, irq and register map are done or by load () -* of exynos drm driver. -* -* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +0
-6-*/ - ret = subdrv->probe (dev, subdrv->dev); -if (ret) -return ret; - } -if (!subdrv->manager)return 0 ; @@ -78,24 +63,22 @@ static int exynos_drm_subdrv_probe(struct
drm_device
*dev,connector = exynos_drm_connector_create(dev, encoder); if (!connector) { DRM_ERROR("failed to create connector\n");drivers/gpu/drm/exynos/exynos_drm_core.c +7
-3- encoder->funcs->destroy (encoder); -return -EFAULT ; + ret = -EFAULT ; + goto err_destroy_encoder; } subdrv->encoder = encoder; subdrv->connector = connector;return 0 ; + +err_destroy_encoder: + encoder->funcs->destroy (encoder); +return ret; } -static void exynos_drm_subdrv_remove(struct drm_device *dev, -struct exynos_drm_subdrv *subdrv) +static void exynos_drm_destroy_enc_conn(struct exynos_drm_subdrv*subdrv)
{drivers/gpu/drm/exynos/exynos_drm_core.c +0
-5-DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - -if (subdrv->remove) - subdrv->remove (dev); -if (subdrv->encoder) {struct drm_encoder *encoder = subdrv->encoder; encoder->funcs->destroy (encoder);@@ -109,9 +92,48 @@ static void exynos_drm_subdrv_remove(struct
drm_device
*dev,} } +static int exynos_drm_subdrv_probe(struct drm_device *dev,+ struct
exynos_drm_subdrv
*subdrv)drivers/gpu/drm/exynos/exynos_drm_core.c +10
-0+{ +if (subdrv->probe) { +int ret; + + subdrv->drm_dev = dev; + +/* +* this probe callback would be called by sub driver +* after setting of all resources to this sub driver, +* such as clock, irq and register map are done or by
load()drivers/gpu/drm/exynos/exynos_drm_core.c +3
-0+* of exynos drm driver. +* +* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +39
-1+*/ + ret = subdrv->probe (dev, subdrv->dev); +if (ret) +return ret; + } + +if (!subdrv->manager) +return -EINVAL ; + + subdrv->manager->dev = subdrv->dev; + +return 0 ; +} + +static void exynos_drm_subdrv_remove (struct drm_device *dev, +struct exynos_drm_subdrv *subdrv) +{ +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + +if (subdrv->remove) + subdrv->remove (dev, subdrv->dev); +} +int exynos_drm_device_register (struct drm_device *dev) {struct exynos_drm_subdrv *subdrv, *n; +unsigned int fine_cnt =0 ;int err;DRM_DEBUG_DRIVER ("%s\n" , __FILE__);@@ -120,14 +142,27 @@ int exynos_drm_device_register(struct drm_device *dev)return -EINVAL ;list_for_each_entry_safe (subdrv, n, &exynos_drm_subdrv_list, list) { - subdrv->drm_dev = dev; err =exynos_drm_subdrv_probe (dev, subdrv);if (err) {DRM_DEBUG ("exynos drm subdrv probe failed.\n" );list_del (&subdrv->list); +continue ; } + + err =exynos_drm_create_enc_conn (dev, subdrv); +if (err) { + DRM_DEBUG("failed to create encoder and connector.\n"); +exynos_drm_subdrv_remove (dev, subdrv); +list_del (&subdrv->list); +continue ; + } + + fine_cnt++; } + if (!fine_cnt) + return -EINVAL; +return 0 ; }EXPORT_SYMBOL_GPL (exynos_drm_device_register);@@ -143,8 +178,10 @@ int exynos_drm_device_unregister(struct drm_device *dev)return -EINVAL ; } - list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) +list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) {exynos_drm_subdrv_remove (dev, subdrv); +exynos_drm_destroy_enc_conn (subdrv);Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_core.c int exynos_drm_device_register(struct drm_device *dev) · line 167
Quoted 3 lines
drivers/gpu/drm/exynos/exynos_drm_core.c +1
-0+ }return 0 ; }_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
InKi Dae
maintainerRe: [PATCH 02/13] drm/exynos: separated subdrv->probe call and encoder/connector creation.
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 25 lines · InKi Dae
Quoted 24 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 22 lines · InKi Dae
Quoted 12 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 10 lines · Inki Dae
Quoted 6 lines
this patch separates sub driver's probe call and encoder/connector creation
so that exynos drm core module can take exception when some operation was
failed properly.Quoted 4 lines
Quoted 2 lines
Which exceptions? I don't know this patch gives any benefit to us.
previous code didn't take exception when
exynos_drm_encoder_create()is falied.No, it is considered.
Quoted 8 lines
Quoted 4 lines
where is
subdrv->remove()called whenexynos_drm_encoder_create()is failed? I think if failed thensubdrv->remove()should be called and ifexynos_drm_connector_create()is failed then not onlyencoder->funcs->destory()but alsosubdrv->remove()OK, but just add
subdrv->remove(). Then if it needs, please split function.
now exynos_drm_subdrv_probe() creates encoder and connector so it should be separated into meaningful parts.
Quoted 200 lines
Quoted 190 lines
Quoted 190 lines
Quoted 4 lines
and for now, exynos_drm_encoder/connector_create functions was called at
exynos_drm_subdrv_probe()so know that this patch is for code clean by separating them into two parts also.It's ok, but it just splitting.
Quoted 179 lines
Quoted 179 lines
Quoted 167 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_core.c | 93 +++++++++++++++++++++--------- 1 files changed, 65 insertions(+), 28 deletions(-)drivers/gpu/drm/exynos/exynos_drm_core.c +2
-9@@ -34,30 +34,15 @@static LIST_HEAD (exynos_drm_subdrv_list); -static int exynos_drm_subdrv_probe(struct drm_device *dev, +static int exynos_drm_create_enc_conn (struct drm_device *dev,struct exynos_drm_subdrv *subdrv) {struct drm_encoder *encoder;struct drm_connector *connector; +int ret;DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - if (subdrv->probe) { -int ret; - -/* -* this probe callback would be called by sub driver -* after setting of all resources to this sub driver, -* such as clock, irq and register map are done or by load () -* of exynos drm driver. -* -* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +0
-6-*/ - ret = subdrv->probe (dev, subdrv->dev); -if (ret) -return ret; - } -if (!subdrv->manager)return 0 ; @@ -78,24 +63,22 @@ static int exynos_drm_subdrv_probe(struct
drm_device
*dev,connector = exynos_drm_connector_create(dev, encoder); if (!connector) { DRM_ERROR("failed to create connector\n");drivers/gpu/drm/exynos/exynos_drm_core.c +6
-3- encoder->funcs->destroy (encoder); -return -EFAULT ; + ret = -EFAULT ; + goto err_destroy_encoder; } subdrv->encoder = encoder; subdrv->connector = connector;return 0 ; + +err_destroy_encoder: + encoder->funcs->destroy (encoder); +return ret; } -static void exynos_drm_subdrv_remove(struct drm_device *dev, - struct exynos_drm_subdrv*subdrv)
+static voidexynos_drm_destroy_enc_conn(struct exynos_drm_subdrv *subdrv){drivers/gpu/drm/exynos/exynos_drm_core.c +0
-5-DRM_DEBUG_DRIVER ("%s\n" , __FILE__); - -if (subdrv->remove) - subdrv->remove (dev); -if (subdrv->encoder) {struct drm_encoder *encoder = subdrv->encoder; encoder->funcs->destroy (encoder);@@ -109,9 +92,48 @@ static void exynos_drm_subdrv_remove(struct
drm_device
*dev,} } +static int exynos_drm_subdrv_probe(struct drm_device *dev,+ struct
exynos_drm_subdrv
*subdrv)drivers/gpu/drm/exynos/exynos_drm_core.c +10
-0+{ +if (subdrv->probe) { +int ret; + + subdrv->drm_dev = dev; + +/* +* this probe callback would be called by sub driver +* after setting of all resources to this sub driver, +* such as clock, irq and register map are done or by
load()drivers/gpu/drm/exynos/exynos_drm_core.c +3
-0+* of exynos drm driver. +* +* P.S. note that this driver is considered for modularization.
drivers/gpu/drm/exynos/exynos_drm_core.c +16
-0+*/ + ret = subdrv->probe (dev, subdrv->dev); +if (ret) +return ret; + } + +if (!subdrv->manager) +return -EINVAL ; + + subdrv->manager->dev = subdrv->dev; + +return 0 ; +} + +static void exynos_drm_subdrv_remove (struct drm_device *dev, + struct exynos_drm_subdrv*subdrv)
drivers/gpu/drm/exynos/exynos_drm_core.c +21
-1+{ +DRM_DEBUG_DRIVER ("%s\n" , __FILE__); + +if (subdrv->remove) + subdrv->remove (dev, subdrv->dev); +} +int exynos_drm_device_register (struct drm_device *dev) {struct exynos_drm_subdrv *subdrv, *n; +unsigned int fine_cnt =0 ;int err;DRM_DEBUG_DRIVER ("%s\n" , __FILE__);@@ -120,14 +142,27 @@ int exynos_drm_device_register(struct drm_device *dev)return -EINVAL ;list_for_each_entry_safe (subdrv, n, &exynos_drm_subdrv_list, list) { - subdrv->drm_dev = dev; err =exynos_drm_subdrv_probe (dev, subdrv);if (err) { DRM_DEBUG("exynos drm subdrv probe failed.\n");list_del (&subdrv->list); +continue ; } + + err =exynos_drm_create_enc_conn (dev, subdrv); +if (err) { + DRM_DEBUG("failed to create encoder and connector.\n"); +exynos_drm_subdrv_remove (dev, subdrv); +list_del (&subdrv->list); +continue ; + } + + fine_cnt++; } + if (!fine_cnt) + return -EINVAL; +return 0 ; }EXPORT_SYMBOL_GPL (exynos_drm_device_register);@@ -143,8 +178,10 @@ int exynos_drm_device_unregister(struct
drm_device
*dev)return -EINVAL; } - list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list)drivers/gpu/drm/exynos/exynos_drm_core.c int exynos_drm_device_unregister(struct drm_device *dev) · line 187
Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_core.c +3
-0+list_for_each_entry (subdrv, &exynos_drm_subdrv_list, list) {exynos_drm_subdrv_remove (dev, subdrv); +exynos_drm_destroy_enc_conn (subdrv); + }return 0 ; }_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-develQuoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerPATCH 3/13 drm/exynos: fixed page align bug.
In reply to Inki Daedo not align in page unit at dumb creation. the align is done by exynos_drm_gem_create() to be called commonly.
--- drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_gem.c +1 -1
@@ -662,7 +662,7 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,*/ args->pitch = args->width * ((args->bpp +7 ) /8 ); - args->size =PAGE_ALIGN (args->pitch * args->height); + args->size = args->pitch * args->height; exynos_gem_obj =exynos_drm_gem_create (dev, args->flags, args->size);if (IS_ERR (exynos_gem_obj))
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 4/13 drm/exynos: use empty function instead of drm_helper_connector_dpms
In reply to Inki Daecrtc and encoder's dpms callback will be called before connector's dpms is called so drm_helper_connector_dpms doesn't need to be called.
--- drivers/gpu/drm/exynos/exynos_drm_connector.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_connector.c +8 -1
@@ -226,6 +226,13 @@ static struct drm_connector_helper_funcs exynos_connector_helper_funcs = { .best_encoder = exynos_drm_best_encoder, }; +static void exynos_drm_connector_dpms (struct drm_connector *connector,int mode) +{ +DRM_DEBUG_KMS ("%s\n" , __FILE__); + +/* drm framework doesn't check NULL. */ +} +static int exynos_drm_connector_fill_modes (struct drm_connector *connector,unsigned int max_width,unsigned int max_height) {
@@ -285,7 +292,7 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector) }static struct drm_connector_funcs exynos_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = exynos_drm_connector_dpms, .fill_modes = exynos_drm_connector_fill_modes, .detect = exynos_drm_connector_detect, .destroy = exynos_drm_connector_destroy,
Signature · 1 line
1.7.4.1
Re: [PATCH 04/13] drm/exynos: use empty function instead of drm_helper_connector_dpms
Quoted 2 lines · Inki Dae
crtc and encoder's dpms callback will be called before connector's dpms is called so
drm_helper_connector_dpmsdoesn't need to be called.
I can't understand this description. I know crtc and encoder dpms are called by drm_helper_connector_dpms.
Quoted 33 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_connector.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)drivers/gpu/drm/exynos/exynos_drm_connector.c +8
-1@@ -226,6 +226,13 @@ static struct drm_connector_helper_funcs exynos_connector_helper_funcs = { .best_encoder = exynos_drm_best_encoder, }; +static void exynos_drm_connector_dpms (struct drm_connector *connector,int mode) +{ +DRM_DEBUG_KMS ("%s\n" , __FILE__); + +/* drm framework doesn't check NULL. */ +} +static int exynos_drm_connector_fill_modes (struct drm_connector *connector,unsigned int max_width,unsigned int max_height) {@@ -285,7 +292,7 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector) }static struct drm_connector_funcs exynos_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = exynos_drm_connector_dpms, .fill_modes = exynos_drm_connector_fill_modes, .detect = exynos_drm_connector_detect, .destroy = exynos_drm_connector_destroy,
InKi Dae
maintainerRe: [PATCH 04/13] drm/exynos: use empty function instead of drm_helper_connector_dpms
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 9 lines · Inki Dae
Quoted 3 lines
crtc and encoder's dpms callback will be called before connector's dpms is called so
drm_helper_connector_dpmsdoesn't need to be called.I can't understand this description. I know crtc and encoder dpms are called by
drm_helper_connector_dpms.
Ah, right. there is my missing point. for pm, we need drm_helper_connector_dpms call. actually, this patch is for avoiding duplicated call of mode_set but I didn't consider pm.
Thanks.
Quoted 44 lines
Quoted 30 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_connector.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)drivers/gpu/drm/exynos/exynos_drm_connector.c +6
-0@@ -226,6 +226,13 @@ static struct drm_connector_helper_funcs exynos_connector_helper_funcs = { .best_encoder = exynos_drm_best_encoder, }; +static void exynos_drm_connector_dpms(struct drm_connector *connector,int mode) +{ +DRM_DEBUG_KMS ("%s\n" , __FILE__); + +/* drm framework doesn't check NULL. */ +} + static int exynos_drm_connector_fill_modes(struct drm_connector*connector,
unsigned intmax_width, unsigned intmax_height)
{drivers/gpu/drm/exynos/exynos_drm_connector.c static void exynos_drm_connector_destroy(struct · line 298
Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_connector.c +1
-1@@ -285,7 +292,7 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector) }static struct drm_connector_funcs exynos_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = exynos_drm_connector_dpms, .fill_modes = exynos_drm_connector_fill_modes, .detect = exynos_drm_connector_detect, .destroy = exynos_drm_connector_destroy,_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerPATCH 5/13 drm/exynos: removed exynos_drm_encoder_dpms call
In reply to Inki Daeencoder's mode_set callback isn't specific to hardware so it doesn't need to call exynos_drm_encoder_dpms().
--- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_encoder.c +0 -2
@@ -138,8 +138,6 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,DRM_DEBUG_KMS ("%s\n" , __FILE__); -exynos_drm_encoder_dpms (encoder,DRM_MODE_DPMS_ON ); -list_for_each_entry (connector, &dev->mode_config.connector_list, head) {if (connector->encoder == encoder)if (manager_ops && manager_ops->mode_set)
Signature · 1 line
1.7.4.1
Re: [PATCH 05/13] drm/exynos: removed exynos_drm_encoder_dpms call
Quoted 2 lines · Inki Dae
encoder's
mode_setcallback isn't specific to hardware so it doesn't need to callexynos_drm_encoder_dpms().
Then, where is exynos_drm_encoder_dpms() called?
Quoted 20 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)drivers/gpu/drm/exynos/exynos_drm_encoder.c +0
-2@@ -138,8 +138,6 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,DRM_DEBUG_KMS ("%s\n" , __FILE__); -exynos_drm_encoder_dpms (encoder,DRM_MODE_DPMS_ON ); -list_for_each_entry (connector, &dev->mode_config.connector_list, head) {if (connector->encoder == encoder)if (manager_ops && manager_ops->mode_set)
InKi Dae
maintainerRe: [PATCH 05/13] drm/exynos: removed exynos_drm_encoder_dpms call
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 8 lines · Inki Dae
Quoted 3 lines
encoder's
mode_setcallback isn't specific to hardware so it doesn't need to callexynos_drm_encoder_dpms().Then, where is
exynos_drm_encoder_dpms()called?
with this patch series, exynos_drm_encoder_dpms() will call apply callback to set local overlay data to real hardware registers and exynos_drm_crtc_dpms() will be used to enable/disable fimd or hdmi power(clock and regulator). actually, previous codes called mode_set two times so this could make it messed up other display sub devices such as mDNIe.
Quoted 28 lines
Quoted 14 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)drivers/gpu/drm/exynos/exynos_drm_encoder.c +0
-0drivers/gpu/drm/exynos/exynos_drm_encoder.c static void exynos_drm_encoder_mode_set(struct · line 143
Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_encoder.c +0
-1@@ -138,8 +138,6 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,DRM_DEBUG_KMS ("%s\n" , __FILE__); -exynos_drm_encoder_dpms (encoder,DRM_MODE_DPMS_ON ); -list_for_each_entry (connector, &dev->mode_config.connector_list, head) {if (connector->encoder == encoder)if (manager_ops && manager_ops->mode_set)_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerPATCH 6/13 drm/exynos: separeated fimd_power_on into some parts.
In reply to Inki Daethis patch separetes fimd_power_on into fimd_activate and fimd_clock and fimd_activate function will call fimd_clock to control fimd power and vsync interrupt.
--- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 60 ++++++++++++++++++++---------- 1 files changed, 40 insertions(+), 20 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +40 -20
@@ -747,16 +747,10 @@ static void fimd_clear_win(struct fimd_context *ctx, int win)writel (val, ctx->regs +SHADOWCON ); } -static int fimd_power_on (struct fimd_context *ctx,bool enable) +static int fimd_clock (struct fimd_context *ctx,bool enable) { -struct exynos_drm_subdrv *subdrv = &ctx->subdrv; -struct device *dev = subdrv->dev; -DRM_DEBUG_KMS ("%s\n" , __FILE__); -if (enable != false && enable != true) -return -EINVAL ; -if (enable) {int ret;
@@ -769,18 +763,31 @@ static int fimd_power_on(struct fimd_context *ctx, bool enable)clk_disable (ctx->bus_clk);return ret; } + }else { +clk_disable (ctx->lcd_clk); +clk_disable (ctx->bus_clk); + } - ctx->suspended = false; +return 0 ; +} + +static int fimd_activate (struct fimd_context *ctx,bool enable) +{ +if (enable) { +int ret; +struct device *dev = ctx->subdrv.dev; + + ret =fimd_clock (ctx, true); +if (ret <0 ) +return ret;/* if vblank was enabled status, enable it again. */ if (test_and_clear_bit (0 , &ctx->irq_flags))fimd_enable_vblank (dev); -fimd_apply (dev); + ctx->suspended = false; }else { -clk_disable (ctx->lcd_clk); -clk_disable (ctx->bus_clk); - +fimd_clock (ctx, false); ctx->suspended = true; }
@@ -930,15 +937,15 @@ static int fimd_suspend(struct device *dev) {struct fimd_context *ctx =get_fimd_context (dev); -if (pm_runtime_suspended (dev)) -return 0 ; -/* * do not use pm_runtime_suspend(). if pm_runtime_suspend() is * called here, an error would be returned by that interface * because the usage_count of pm runtime is more than 1. */ -return fimd_power_on (ctx, false); +if (!pm_runtime_suspended (dev)) +return fimd_activate (ctx, false); + +return 0 ; }static int fimd_resume (struct device *dev)
@@ -950,8 +957,21 @@ static int fimd_resume(struct device *dev)* of pm runtime would still be 1 so in this case, fimd driver * should be on directly not drawing on pm runtime interface. */ -if (!pm_runtime_suspended (dev)) -return fimd_power_on (ctx, true); +if (pm_runtime_suspended (dev)) { +int ret; + + ret =fimd_activate (ctx, false); +if (ret <0 ) +return ret; + +/* +* in case of dpms on(standby), fimd_apply function will +* be called by encoder's dpms callback to update fimd's +* registers but in case of sleep wakeup, it's not. +* so fimd_apply function should be called at here. +*/ +fimd_apply (dev); + }return 0 ; }
@@ -964,7 +984,7 @@ static int fimd_runtime_suspend(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__); -return fimd_power_on (ctx, false); +return fimd_activate (ctx, false); }static int fimd_runtime_resume (struct device *dev)
@@ -973,7 +993,7 @@ static int fimd_runtime_resume(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__); - return fimd_power_on(ctx, true); + return fimd_activate(ctx, true); }#endif
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 7/13 drm/exynos: control display power at connector module.
In reply to Inki Daeit doesn't need that display power is controlled by encoder's dpms so moves it into connector module so that the display power can be controlled by connector's dpms propely.
--- drivers/gpu/drm/exynos/exynos_drm_connector.c | 11 ++++++++++- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 21 --------------------- 2 files changed, 10 insertions(+), 22 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_connector.c +10 -1
@@ -226,11 +226,20 @@ static struct drm_connector_helper_funcs exynos_connector_helper_funcs = { .best_encoder = exynos_drm_best_encoder, }; +static void exynos_drm_display_power (struct drm_encoder *encoder,int mode) +{ +struct exynos_drm_manager *manager =exynos_drm_get_manager (encoder); +struct exynos_drm_display_ops *display_ops = manager->display_ops; + +if (display_ops && display_ops->power_on) + display_ops->power_on (manager->dev, mode); +} +static void exynos_drm_connector_dpms (struct drm_connector *connector,int mode) {DRM_DEBUG_KMS ("%s\n" , __FILE__); -/* drm framework doesn't check NULL. */ +exynos_drm_display_power (connector->encoder, mode); } static int exynos_drm_connector_fill_modes(struct drm_connector *connector,
drivers/gpu/drm/exynos/exynos_drm_encoder.c +0 -21
@@ -49,25 +49,6 @@ struct exynos_drm_encoder {int dpms; }; -static void exynos_drm_display_power (struct drm_encoder *encoder,int mode) -{ -struct drm_device *dev = encoder->dev; -struct drm_connector *connector; -struct exynos_drm_manager *manager =exynos_drm_get_manager (encoder); - -list_for_each_entry (connector, &dev->mode_config.connector_list, head) { -if (connector->encoder == encoder) { -struct exynos_drm_display_ops *display_ops = - manager->display_ops; - -DRM_DEBUG_KMS ("connector[%d] dpms[%d]\n" , - connector->base.id, mode); -if (display_ops && display_ops->power_on) - display_ops->power_on (manager->dev, mode); - } - } -} -static void exynos_drm_encoder_dpms (struct drm_encoder *encoder,int mode) {struct drm_device *dev = encoder->dev;
@@ -88,13 +69,11 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)case DRM_MODE_DPMS_ON :if (manager_ops && manager_ops->apply) manager_ops->apply (manager->dev); -exynos_drm_display_power (encoder, mode); exynos_encoder->dpms = mode;break ;case DRM_MODE_DPMS_STANDBY :case DRM_MODE_DPMS_SUSPEND :case DRM_MODE_DPMS_OFF : -exynos_drm_display_power (encoder, mode); exynos_encoder->dpms = mode;break ;default :
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 8/13 drm/exynos: make sure that hardware overlay for fimd is disabled
In reply to Inki Daethe values set to registers will be updated into real registers at vsync so dma operation could be malfunctioned when accessed to memory after gem buffer was released. this patch makes sure that hw overlay is disabled before the gem buffer is released.
--- drivers/gpu/drm/exynos/exynos_drm_drv.h | 17 +++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_encoder.c | 10 ++++++++++ drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 ++++++++++++ 3 files changed, 39 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.h +17 -0
@@ -37,6 +37,20 @@#define MAX_FB_BUFFER 4#define DEFAULT_ZPOS -1 +#define _wait_for (COND ,MS ) ({ \ + unsigned long timeout__ = jiffies + msecs_to_jiffies(MS); \ + int ret__ = 0; \ + while (!(COND)) { \ + if (time_after(jiffies, timeout__)) { \ + ret__ = -ETIMEDOUT; \ + break; \ + } \ + } \ + ret__; \ +}) + +#define wait_for (COND ,MS ) _wait_for(COND, MS) +struct drm_device ;struct exynos_drm_overlay ;struct drm_connector ;
@@ -61,6 +75,8 @@ enum exynos_drm_output_type {* @commit: apply hardware specific overlay data to registers. * @enable: enable hardware specific overlay. * @disable: disable hardware specific overlay. +* @wait_for_vblank: wait for vblank interrupt to make sure that +* dma transfer is completed. */ struct exynos_drm_overlay_ops { void (*mode_set)(struct device *subdrv_dev,
@@ -68,6 +84,7 @@ struct exynos_drm_overlay_ops {void (*commit)(struct device *subdrv_dev,int zpos);void (*enable)(struct device *subdrv_dev,int zpos);void (*disable)(struct device *subdrv_dev,int zpos); +void (*wait_for_vblank)(struct device *subdrv_dev); };/*
drivers/gpu/drm/exynos/exynos_drm_encoder.c +10 -0
@@ -399,4 +399,14 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data)if (overlay_ops && overlay_ops->disable) overlay_ops->disable (manager->dev, zpos); + +/* +* wait for vblank interrupt +* - with iommu, the dma operation could induce page fault +* when accessed to memory after gem buffer was released so +* make sure that the dma operation is completed before releasing +* the gem bufer. +*/ +if (overlay_ops->wait_for_vblank) + overlay_ops->wait_for_vblank (manager->dev); }
drivers/gpu/drm/exynos/exynos_drm_fimd.c +12 -0
@@ -570,10 +570,22 @@ static void fimd_win_disable(struct device *dev, int zpos) win_data->enabled = false; } +static void fimd_wait_for_vblank (struct device *dev) +{ +struct fimd_context *ctx =get_fimd_context (dev); +int ret; + + ret =wait_for ((__raw_readl (ctx->regs +VIDCON1 ) & +VIDCON1_VSTATUS_BACKPORCH ),50 ); +if (ret <0 ) +DRM_DEBUG_KMS ("vblank wait timed out.\n" ); +} +static struct exynos_drm_overlay_ops fimd_overlay_ops = { .mode_set = fimd_win_mode_set, .commit = fimd_win_commit, .disable = fimd_win_disable, + .wait_for_vblank = fimd_wait_for_vblank, };static struct exynos_drm_manager fimd_manager = {
Signature · 1 line
1.7.4.1
Re: [PATCH 08/13] drm/exynos: make sure that hardware overlay for fimd is disabled
Quoted 11 lines · Inki Dae
the values set to registers will be updated into real registers at vsync so dma operation could be malfunctioned when accessed to memory after gem buffer was released. this patch makes sure that hw overlay is disabled before the gem buffer is released.
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_drv.h | 17 +++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_encoder.c | 10 ++++++++++ drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 ++++++++++++
Please split patch to exynos_drm part and fimd part.
Quoted 90 lines
3 files changed, 39 insertions(+), 0 deletions(-)drivers/gpu/drm/exynos/exynos_drm_drv.h +17
-0@@ -37,6 +37,20 @@#define MAX_FB_BUFFER 4#define DEFAULT_ZPOS -1 +#define _wait_for (COND ,MS ) ({ \ + unsigned long timeout__ = jiffies + msecs_to_jiffies(MS); \ + int ret__ = 0; \ + while (!(COND)) { \ + if (time_after(jiffies, timeout__)) { \ + ret__ = -ETIMEDOUT; \ + break; \ + } \ + } \ + ret__; \ +}) + +#define wait_for (COND ,MS ) _wait_for(COND, MS) +struct drm_device ;struct exynos_drm_overlay ;struct drm_connector ;@@ -61,6 +75,8 @@ enum exynos_drm_output_type {* @commit: apply hardware specific overlay data to registers. * @enable: enable hardware specific overlay. * @disable: disable hardware specific overlay. +* @wait_for_vblank: wait for vblank interrupt to make sure that +* dma transfer is completed. */ struct exynos_drm_overlay_ops { void (*mode_set)(struct device *subdrv_dev,@@ -68,6 +84,7 @@ struct exynos_drm_overlay_ops {void (*commit)(struct device *subdrv_dev,int zpos);void (*enable)(struct device *subdrv_dev,int zpos);void (*disable)(struct device *subdrv_dev,int zpos); +void (*wait_for_vblank)(struct device *subdrv_dev); };/* drivers/gpu/drm/exynos/exynos_drm_encoder.c +10
-0@@ -399,4 +399,14 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data)if (overlay_ops && overlay_ops->disable) overlay_ops->disable (manager->dev, zpos); + +/* +* wait for vblank interrupt +* - with iommu, the dma operation could induce page fault +* when accessed to memory after gem buffer was released so +* make sure that the dma operation is completed before releasing +* the gem bufer. +*/ +if (overlay_ops->wait_for_vblank) + overlay_ops->wait_for_vblank (manager->dev); }drivers/gpu/drm/exynos/exynos_drm_fimd.c +12
-0@@ -570,10 +570,22 @@ static void fimd_win_disable(struct device *dev, int zpos) win_data->enabled = false; } +static void fimd_wait_for_vblank (struct device *dev) +{ +struct fimd_context *ctx =get_fimd_context (dev); +int ret; + + ret =wait_for ((__raw_readl (ctx->regs +VIDCON1 ) & +VIDCON1_VSTATUS_BACKPORCH ),50 ); +if (ret <0 ) +DRM_DEBUG_KMS ("vblank wait timed out.\n" ); +} +static struct exynos_drm_overlay_ops fimd_overlay_ops = { .mode_set = fimd_win_mode_set, .commit = fimd_win_commit, .disable = fimd_win_disable, + .wait_for_vblank = fimd_wait_for_vblank, };static struct exynos_drm_manager fimd_manager = {
Inki Dae
maintainerPATCH 9/13 drm/exynos: check NV12M format specific to Exynos properly
In reply to Inki Daethis patch adds buf_cnt variable in exynos_drm_fb structure and that means a buffer count to drm framebuffer and also adds two functions to get/set the buffer count from/to exynos_drm_fb structure. if pixel format is not DRM_FORMAT_NV12MT then it gets a buffer count to drm framebuffer refering to mode_cmd->handles and offsets. but when booted, the buffer count will always be 1 because pixel format of console framebuffer is RGB format.
--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 65 +++++++++++++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_fb.h | 20 +++------ drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 + drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- 4 files changed, 73 insertions(+), 17 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fb.c +62 -3
@@ -41,10 +41,12 @@* exynos specific framebuffer structure. * * @fb: drm framebuffer obejct. +* @buf_cnt: a buffer count to drm framebuffer. * @exynos_gem_obj: array of exynos specific gem object containing a gem object. */ struct exynos_drm_fb {struct drm_framebuffer fb; +unsigned int buf_cnt;struct exynos_drm_gem_obj *exynos_gem_obj[MAX_FB_BUFFER ]; };
@@ -101,6 +103,25 @@ static struct drm_framebuffer_funcs exynos_drm_fb_funcs = { .dirty = exynos_drm_fb_dirty, }; +void exynos_drm_fb_set_buf_cnt (struct drm_framebuffer *fb, +unsigned int cnt) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + + exynos_fb->buf_cnt = cnt; +} + +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + +return exynos_fb->buf_cnt; +} +struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,
@@ -127,6 +148,43 @@ exynos_drm_framebuffer_init(struct drm_device *dev,return &exynos_fb->fb; } +static u32 exynos_drm_format_num_buffers (struct drm_mode_fb_cmd2 *mode_cmd) +{ +unsigned int cnt =0 ; + +if (mode_cmd->pixel_format ==DRM_FORMAT_NV12MT ) +return 2 ; + +while (cnt !=MAX_FB_BUFFER ) { +if (!mode_cmd->handles[cnt]) +break ; + cnt++; + } + +/* +* check if NV12 or NV12M. +* +* NV12 +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base1, offsets[1] = Y_size +* +* NV12M +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base2, offsets[1] = 0 +*/ +if (cnt ==2 ) { +/* +* in case of NV12 format, offsets[1] is not 0 and +* handles[0] is same as handles[1]. +*/ +if (mode_cmd->offsets[1 ] && + mode_cmd->handles[0 ] == mode_cmd->handles[1 ]) + cnt =1 ; + } + +return cnt; +} +static struct drm_framebuffer *exynos_user_fb_create (struct drm_device *dev,struct drm_file *file_priv,struct drm_mode_fb_cmd2 *mode_cmd)
@@ -134,7 +192,6 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,struct drm_gem_object *obj;struct drm_framebuffer *fb;struct exynos_drm_fb *exynos_fb; -int nr;int i;DRM_DEBUG_KMS ("%s\n" , __FILE__);
@@ -152,9 +209,11 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, } exynos_fb =to_exynos_fb (fb); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + exynos_fb->buf_cnt =exynos_drm_format_num_buffers (mode_cmd); + +DRM_DEBUG_KMS ("buf_cnt = %d\n" , exynos_fb->buf_cnt); -for (i =1 ; i < nr; i++) { +for (i =1 ; i < exynos_fb->buf_cnt; i++) { obj =drm_gem_object_lookup (dev, file_priv, mode_cmd->handles[i]);if (!obj) {
drivers/gpu/drm/exynos/exynos_drm_fb.h +7 -13
@@ -28,19 +28,6 @@#ifndef _EXYNOS_DRM_FB_H_#define _EXYNOS_DRM_FB_H -static inline int exynos_drm_format_num_buffers (uint32_t format) -{ -switch (format) { -case DRM_FORMAT_NV12 : -case DRM_FORMAT_NV12MT : -return 2 ; -case DRM_FORMAT_YUV420 : -return 3 ; -default : -return 1 ; - } -} -struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,
@@ -52,4 +39,11 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb,void exynos_drm_mode_config_init (struct drm_device *dev); +/* set a buffer count to drm framebuffer. */ +void exynos_drm_fb_set_buf_cnt (struct drm_framebuffer *fb, +unsigned int cnt); + +/* get a buffer count to drm framebuffer. */ +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb); +#endif
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +3 -0
@@ -79,6 +79,9 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,return -EFAULT ; } +/* buffer count to framebuffer always is 1 at booting time. */ +exynos_drm_fb_set_buf_cnt (fb,1 ); + offset = fbi->var.xoffset * (fb->bits_per_pixel >>3 ); offset += fbi->var.yoffset * fb->pitches[0 ];
drivers/gpu/drm/exynos/exynos_drm_plane.c +1 -1
@@ -48,7 +48,7 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + nr =exynos_drm_fb_get_buf_cnt (fb);for (i =0 ; i < nr; i++) {struct exynos_drm_gem_buf *buffer =exynos_drm_fb_buffer (fb, i);
Signature · 1 line
1.7.4.1
Re: [PATCH 09/13] drm/exynos: check NV12M format specific to Exynos properly
Quoted 90 lines · Inki Dae
this patch adds
buf_cntvariable inexynos_drm_fbstructure and that means a buffer count to drm framebuffer and also adds two functions to get/set the buffer count from/toexynos_drm_fbstructure. if pixel format is notDRM_FORMAT_NV12MTthen it gets a buffer count to drm framebuffer refering tomode_cmd->handlesand offsets. but when booted, the buffer count will always be 1 because pixel format of console framebuffer is RGB format.Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 65 +++++++++++++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_fb.h | 20 +++------ drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 + drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- 4 files changed, 73 insertions(+), 17 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fb.c +47
-0@@ -41,10 +41,12 @@* exynos specific framebuffer structure. * * @fb: drm framebuffer obejct. +* @buf_cnt: a buffer count to drm framebuffer. * @exynos_gem_obj: array of exynos specific gem object containing a gem object. */ struct exynos_drm_fb {struct drm_framebuffer fb; +unsigned int buf_cnt;struct exynos_drm_gem_obj *exynos_gem_obj[MAX_FB_BUFFER ]; };@@ -101,6 +103,25 @@ static struct drm_framebuffer_funcs exynos_drm_fb_funcs = { .dirty = exynos_drm_fb_dirty, }; +void exynos_drm_fb_set_buf_cnt (struct drm_framebuffer *fb, +unsigned int cnt) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + + exynos_fb->buf_cnt = cnt; +} + +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + +return exynos_fb->buf_cnt; +} +struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -127,6 +148,43 @@ exynos_drm_framebuffer_init(struct drm_device *dev,return &exynos_fb->fb; } +static u32 exynos_drm_format_num_buffers (struct drm_mode_fb_cmd2 *mode_cmd) +{ +unsigned int cnt =0 ; + +if (mode_cmd->pixel_format ==DRM_FORMAT_NV12MT ) +return 2 ; + +while (cnt !=MAX_FB_BUFFER ) { +if (!mode_cmd->handles[cnt]) +break ; + cnt++; + } + +/* +* check if NV12 or NV12M. +* +* NV12 +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base1, offsets[1] = Y_size +* +* NV12M +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base2, offsets[1] = 0 +*/ +if (cnt ==2 ) { +/*
drivers/gpu/drm/exynos/exynos_drm_fb.c exynos_drm_framebuffer_init(struct drm_device *dev, · line 186
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +10
-0+* in case of NV12 format, offsets[1] is not 0 and +* handles[0] is same as handles[1]. +*/ +if (mode_cmd->offsets[1 ] && + mode_cmd->handles[0 ] == mode_cmd->handles[1 ]) + cnt =1 ; + } + +return cnt; +}
No, please don't add specific function. There is already drm_format_num_planes() function
Quoted 89 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +5
-3+static struct drm_framebuffer *exynos_user_fb_create (struct drm_device *dev,struct drm_file *file_priv,struct drm_mode_fb_cmd2 *mode_cmd)@@ -134,7 +192,6 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,struct drm_gem_object *obj;struct drm_framebuffer *fb;struct exynos_drm_fb *exynos_fb; -int nr;int i;DRM_DEBUG_KMS ("%s\n" , __FILE__);@@ -152,9 +209,11 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, } exynos_fb =to_exynos_fb (fb); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + exynos_fb->buf_cnt =exynos_drm_format_num_buffers (mode_cmd); + +DRM_DEBUG_KMS ("buf_cnt = %d\n" , exynos_fb->buf_cnt); -for (i =1 ; i < nr; i++) { +for (i =1 ; i < exynos_fb->buf_cnt; i++) { obj =drm_gem_object_lookup (dev, file_priv, mode_cmd->handles[i]);if (!obj) {drivers/gpu/drm/exynos/exynos_drm_fb.h +7
-13@@ -28,19 +28,6 @@#ifndef _EXYNOS_DRM_FB_H_#define _EXYNOS_DRM_FB_H -static inline int exynos_drm_format_num_buffers (uint32_t format) -{ -switch (format) { -case DRM_FORMAT_NV12 : -case DRM_FORMAT_NV12MT : -return 2 ; -case DRM_FORMAT_YUV420 : -return 3 ; -default : -return 1 ; - } -} -struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -52,4 +39,11 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb,void exynos_drm_mode_config_init (struct drm_device *dev); +/* set a buffer count to drm framebuffer. */ +void exynos_drm_fb_set_buf_cnt (struct drm_framebuffer *fb, +unsigned int cnt); + +/* get a buffer count to drm framebuffer. */ +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb); +#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +3
-0@@ -79,6 +79,9 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,return -EFAULT ; } +/* buffer count to framebuffer always is 1 at booting time. */ +exynos_drm_fb_set_buf_cnt (fb,1 ); + offset = fbi->var.xoffset * (fb->bits_per_pixel >>3 ); offset += fbi->var.yoffset * fb->pitches[0 ];drivers/gpu/drm/exynos/exynos_drm_plane.c +1
-1@@ -48,7 +48,7 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + nr =exynos_drm_fb_get_buf_cnt (fb);for (i =0 ; i < nr; i++) {struct exynos_drm_gem_buf *buffer =exynos_drm_fb_buffer (fb, i);
InKi Dae
maintainerRe: [PATCH 09/13] drm/exynos: check NV12M format specific to Exynos properly
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 100 lines · Inki Dae
Quoted 99 lines
this patch adds
buf_cntvariable inexynos_drm_fbstructure and that means a buffer count to drm framebuffer and also adds two functions to get/set the buffer count from/toexynos_drm_fbstructure. if pixel format is notDRM_FORMAT_NV12MTthen it gets a buffer count to drm framebuffer refering tomode_cmd->handlesand offsets. but when booted, the buffer count will always be 1 because pixel format of console framebuffer is RGB format.Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 65 +++++++++++++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_fb.h | 20 +++------ drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 + drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- 4 files changed, 73 insertions(+), 17 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0@@ -41,10 +41,12 @@* exynos specific framebuffer structure. * * @fb: drm framebuffer obejct. +* @buf_cnt: a buffer count to drm framebuffer. * @exynos_gem_obj: array of exynos specific gem object containing a gem object.
*/struct exynos_drm_fb { struct drm_framebuffer fb; + unsigned int buf_cnt; struct exynos_drm_gem_obj *exynos_gem_obj[MAX_FB_BUFFER];};
@@ -101,6 +103,25 @@ static structdrm_framebuffer_funcsexynos_drm_fb_funcs= {
.dirty =exynos_drm_fb_dirty,
};
+void exynos_drm_fb_set_buf_cnt(structdrm_framebuffer*fb,drivers/gpu/drm/exynos/exynos_drm_fb.c +49
-0+ unsigned int cnt) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + + exynos_fb->buf_cnt = cnt; +} + +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + +return exynos_fb->buf_cnt; +} +struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -127,6 +148,43 @@ exynos_drm_framebuffer_init(struct drm_device *dev,return &exynos_fb->fb; } +static u32 exynos_drm_format_num_buffers(struct drm_mode_fb_cmd2 *mode_cmd) +{ +unsigned int cnt =0 ; + +if (mode_cmd->pixel_format ==DRM_FORMAT_NV12MT ) +return 2 ; + +while (cnt !=MAX_FB_BUFFER ) { +if (!mode_cmd->handles[cnt]) +break ; + cnt++; + } + +/* +* check if NV12 or NV12M. +* +* NV12 +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base1, offsets[1] = Y_size +* +* NV12M +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base2, offsets[1] = 0 +*/ +if (cnt ==2 ) { +/* +* in case of NV12 format, offsets[1] is not 0 and +* handles[0] is same as handles[1]. +*/ +if (mode_cmd->offsets[1 ] && + mode_cmd->handles[0 ] == mode_cmd->handles[1 ]) + cnt =1 ;
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c exynos_drm_framebuffer_init(struct drm_device *dev, · line 186
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +4
-0+ } + +return cnt; +}No, please don't add specific function. There is already
drm_format_num_planes()function
I know that, but NV12M format is specific to Exynos. for this, we already had a discussion and you can refer to below link,
http://web.archiveorange.com/archive/v/hhSc5JAv767vo7fKZLPf
Quoted 95 lines
Quoted 82 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0+static struct drm_framebuffer * exynos_user_fb_create(struct drm_device *dev, struct drm_file
*file_priv,
structdrm_mode_fb_cmd2*mode_cmd)drivers/gpu/drm/exynos/exynos_drm_fb.c +4
-2@@ -134,7 +192,6 @@ exynos_user_fb_create(struct drm_device *dev, structdrm_file *file_priv, struct drm_gem_object *obj;struct drm_framebuffer *fb;struct exynos_drm_fb *exynos_fb; -int nr;int i;DRM_DEBUG_KMS ("%s\n" , __FILE__);@@ -152,9 +209,11 @@ exynos_user_fb_create(struct drm_device *dev, structdrm_file *file_priv, } exynos_fb =to_exynos_fb (fb); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + exynos_fb->buf_cnt =exynos_drm_format_num_buffers (mode_cmd); + +DRM_DEBUG_KMS ("buf_cnt = %d\n" , exynos_fb->buf_cnt); - for (i = 1; i < nr; i++) { +for (i =1 ; i < exynos_fb->buf_cnt; i++) { obj =drm_gem_object_lookup (dev, file_priv, mode_cmd->handles[i]);if (!obj) {drivers/gpu/drm/exynos/exynos_drm_fb.h +6
-12@@ -28,19 +28,6 @@#ifndef _EXYNOS_DRM_FB_H_#define _EXYNOS_DRM_FB_H -static inline int exynos_drm_format_num_buffers(uint32_t format) -{ -switch (format) { -case DRM_FORMAT_NV12 : -case DRM_FORMAT_NV12MT : -return 2 ; -case DRM_FORMAT_YUV420 : -return 3 ; -default : -return 1 ; - } -} - struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -52,4 +39,11 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(structdrm_framebuffer *fb, void exynos_drm_mode_config_init(struct drm_device *dev); +/* set a buffer count to drm framebuffer. */ +void exynos_drm_fb_set_buf_cnt(struct drm_framebuffer *fb, + unsigned int cnt); + +/* get a buffer count to drm framebuffer. */ +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb); +#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +2
-0@@ -79,6 +79,9 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, return -EFAULT ; } +/* buffer count to framebuffer always is 1 at booting time. */ +exynos_drm_fb_set_buf_cnt (fb,1 ); + offset = fbi->var.xoffset * (fb->bits_per_pixel >>3 ); offset += fbi->var.yoffset * fb->pitches[0 ]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index b89829e..777e142 100644drivers/gpu/drm/exynos/exynos_drm_plane.c int exynos_plane_mode_set(struct drm_plane *plane, · line 54
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_plane.c +1
-0@@ -48,7 +48,7 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + nr =exynos_drm_fb_get_buf_cnt (fb);for (i =0 ; i < nr; i++) {struct exynos_drm_gem_buf *buffer =exynos_drm_fb_buffer (fb, i);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/13] drm/exynos: check NV12M format specific to Exynos properly
Quoted 109 lines · InKi Dae
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 98 lines · Inki Dae
Quoted 97 lines
this patch adds
buf_cntvariable inexynos_drm_fbstructure and that means a buffer count to drm framebuffer and also adds two functions to get/set the buffer count from/toexynos_drm_fbstructure. if pixel format is notDRM_FORMAT_NV12MTthen it gets a buffer count to drm framebuffer refering tomode_cmd->handlesand offsets. but when booted, the buffer count will always be 1 because pixel format of console framebuffer is RGB format.Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 65 +++++++++++++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_fb.h | 20 +++------ drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 + drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- 4 files changed, 73 insertions(+), 17 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0@@ -41,10 +41,12 @@* exynos specific framebuffer structure. * * @fb: drm framebuffer obejct. +* @buf_cnt: a buffer count to drm framebuffer. * @exynos_gem_obj: array of exynos specific gem object containing a gem object.
*/ struct exynos_drm_fb { struct drm_framebuffer fb; + unsigned int buf_cnt; struct exynos_drm_gem_obj *exynos_gem_obj[MAX_FB_BUFFER]; }; @@ -101,6 +103,25 @@ static struct drm_framebuffer_funcs
exynos_drm_fb_funcs= {
.dirty =exynos_drm_fb_dirty,
};
+void exynos_drm_fb_set_buf_cnt(structdrm_framebuffer*fb,drivers/gpu/drm/exynos/exynos_drm_fb.c +48
-0+ unsigned int cnt) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + + exynos_fb->buf_cnt = cnt; +} + +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + +return exynos_fb->buf_cnt; +} +struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -127,6 +148,43 @@ exynos_drm_framebuffer_init(struct drm_device *dev,return &exynos_fb->fb; } +static u32 exynos_drm_format_num_buffers(struct drm_mode_fb_cmd2 *mode_cmd) +{ +unsigned int cnt =0 ; + +if (mode_cmd->pixel_format ==DRM_FORMAT_NV12MT ) +return 2 ; + +while (cnt !=MAX_FB_BUFFER ) { +if (!mode_cmd->handles[cnt]) +break ; + cnt++; + } + +/* +* check if NV12 or NV12M. +* +* NV12 +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base1, offsets[1] = Y_size +* +* NV12M +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base2, offsets[1] = 0 +*/ +if (cnt ==2 ) { +/* +* in case of NV12 format, offsets[1] is not 0 and +* handles[0] is same as handles[1]. +*/ +if (mode_cmd->offsets[1 ] && + mode_cmd->handles[0 ] == mode_cmd->handles[1 ])Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c exynos_drm_framebuffer_init(struct drm_device *dev, · line 186
Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +5
-0+ cnt =1 ; + } + +return cnt; +}No, please don't add specific function. There is already
drm_format_num_planes()function
Quoted 3 lines
I know that, but NV12M format is specific to Exynos. for this, we already had a discussion and you can refer to below link,
http://web.archiveorange.com/archive/v/hhSc5JAv767vo7fKZLPf
Yes, but this implementation is not clear, just get plane number using drm_format_num_planes() and check handle and offset argument when format is NV12.
Quoted 94 lines
Quoted 94 lines
Quoted 82 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0+static struct drm_framebuffer * exynos_user_fb_create(struct drm_device *dev, struct drm_file
*file_priv,
structdrm_mode_fb_cmd2*mode_cmd)drivers/gpu/drm/exynos/exynos_drm_fb.c +4
-2@@ -134,7 +192,6 @@ exynos_user_fb_create(struct drm_device *dev, structdrm_file *file_priv, struct drm_gem_object *obj;struct drm_framebuffer *fb;struct exynos_drm_fb *exynos_fb; -int nr;int i;DRM_DEBUG_KMS ("%s\n" , __FILE__);@@ -152,9 +209,11 @@ exynos_user_fb_create(struct drm_device *dev, structdrm_file *file_priv, } exynos_fb =to_exynos_fb (fb); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + exynos_fb->buf_cnt =exynos_drm_format_num_buffers (mode_cmd); + +DRM_DEBUG_KMS ("buf_cnt = %d\n" , exynos_fb->buf_cnt); - for (i = 1; i < nr; i++) { +for (i =1 ; i < exynos_fb->buf_cnt; i++) { obj =drm_gem_object_lookup (dev, file_priv, mode_cmd->handles[i]);if (!obj) {drivers/gpu/drm/exynos/exynos_drm_fb.h +6
-12@@ -28,19 +28,6 @@#ifndef _EXYNOS_DRM_FB_H_#define _EXYNOS_DRM_FB_H -static inline int exynos_drm_format_num_buffers(uint32_t format) -{ -switch (format) { -case DRM_FORMAT_NV12 : -case DRM_FORMAT_NV12MT : -return 2 ; -case DRM_FORMAT_YUV420 : -return 3 ; -default : -return 1 ; - } -} - struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -52,4 +39,11 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(structdrm_framebuffer *fb, void exynos_drm_mode_config_init(struct drm_device *dev); +/* set a buffer count to drm framebuffer. */ +void exynos_drm_fb_set_buf_cnt(struct drm_framebuffer *fb, + unsigned int cnt); + +/* get a buffer count to drm framebuffer. */ +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb); +#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +2
-0@@ -79,6 +79,9 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, return -EFAULT ; } +/* buffer count to framebuffer always is 1 at booting time. */ +exynos_drm_fb_set_buf_cnt (fb,1 ); + offset = fbi->var.xoffset * (fb->bits_per_pixel >>3 ); offset += fbi->var.yoffset * fb->pitches[0 ]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index b89829e..777e142 100644drivers/gpu/drm/exynos/exynos_drm_plane.c int exynos_plane_mode_set(struct drm_plane *plane, · line 54
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_plane.c +1
-0@@ -48,7 +48,7 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + nr =exynos_drm_fb_get_buf_cnt (fb);for (i =0 ; i < nr; i++) {struct exynos_drm_gem_buf *buffer =exynos_drm_fb_buffer (fb, i);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
InKi Dae
maintainerRe: [PATCH 09/13] drm/exynos: check NV12M format specific to Exynos properly
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 115 lines · InKi Dae
Quoted 114 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 112 lines · Inki Dae
Quoted 94 lines
this patch adds
buf_cntvariable inexynos_drm_fbstructure and that means a buffer count to drm framebuffer and also adds two functions to get/set the buffer count from/toexynos_drm_fbstructure. if pixel format is notDRM_FORMAT_NV12MTthen it gets a buffer count to drm framebuffer refering tomode_cmd->handlesand offsets. but when booted, the buffer count will always be 1 because pixel format of console framebuffer is RGB format.Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 65 +++++++++++++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_fb.h | 20 +++------ drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 + drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- 4 files changed, 73 insertions(+), 17 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0@@ -41,10 +41,12 @@* exynos specific framebuffer structure. * * @fb: drm framebuffer obejct. +* @buf_cnt: a buffer count to drm framebuffer. * @exynos_gem_obj: array of exynos specific gem object containing a gem
object.*/ struct exynos_drm_fb { struct drm_framebuffer fb; + unsigned int buf_cnt; struct exynos_drm_gem_obj *exynos_gem_obj[MAX_FB_BUFFER]; }; @@ -101,6 +103,25 @@ static struct drm_framebuffer_funcs
exynos_drm_fb_funcs= {
.dirty =exynos_drm_fb_dirty,
};
+void exynos_drm_fb_set_buf_cnt(structdrm_framebuffer*fb,drivers/gpu/drm/exynos/exynos_drm_fb.c +43
-0+ unsigned int cnt) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + + exynos_fb->buf_cnt = cnt; +} + +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + +return exynos_fb->buf_cnt; +} +struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -127,6 +148,43 @@ exynos_drm_framebuffer_init(struct drm_device *dev,return &exynos_fb->fb; } +static u32 exynos_drm_format_num_buffers(struct drm_mode_fb_cmd2 *mode_cmd) +{ +unsigned int cnt =0 ; + +if (mode_cmd->pixel_format ==DRM_FORMAT_NV12MT ) +return 2 ; + +while (cnt !=MAX_FB_BUFFER ) { +if (!mode_cmd->handles[cnt]) +break ; + cnt++; + } + +/* +* check if NV12 or NV12M. +* +* NV12 +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base1, offsets[1] = Y_size +* +* NV12M +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base2, offsets[1] = 0 +*/ +if (cnt ==2 ) { +/* drivers/gpu/drm/exynos/exynos_drm_fb.c exynos_drm_framebuffer_init(struct drm_device *dev, · line 186
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +10
-0+* in case of NV12 format, offsets[1] is not 0 and +* handles[0] is same as handles[1]. +*/ +if (mode_cmd->offsets[1 ] && + mode_cmd->handles[0 ] == mode_cmd->handles[1 ]) + cnt =1 ; + } + +return cnt; +}No, please don't add specific function. There is already
drm_format_num_planes()function
Quoted 9 lines
Quoted 3 lines
I know that, but NV12M format is specific to Exynos. for this, we already had a discussion and you can refer to below link,
http://web.archiveorange.com/archive/v/hhSc5JAv767vo7fKZLPfYes, but this implementation is not clear, just get plane number using
drm_format_num_planes()
and check handle and offset argument when format is NV12.
drm_format_num_planes() doesn't include NV12MT format type so first that format should be added and then we can get plane count using drm_format_num_planes if not NV12. but if not, exynos_drm_format_num_buffers() like below,
if (mode_cmd == DRM_FORMAT_NV12)
Quoted 104 lines
Quoted 90 lines
Quoted 90 lines
Quoted 90 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0+static struct drm_framebuffer * exynos_user_fb_create(struct drm_device *dev, struct drm_file
*file_priv,
structdrm_mode_fb_cmd2*mode_cmd)drivers/gpu/drm/exynos/exynos_drm_fb.c +0
-1@@ -134,7 +192,6 @@ exynos_user_fb_create(struct drm_device *dev, structdrm_file *file_priv, struct drm_gem_object *obj;struct drm_framebuffer *fb;struct exynos_drm_fb *exynos_fb; -int nr;int i;DRM_DEBUG_KMS ("%s\n" , __FILE__);@@ -152,9 +209,11 @@ exynos_user_fb_create(struct drm_device *dev,struct
drm_file*file_priv,} exynos_fb = to_exynos_fb(fb);drivers/gpu/drm/exynos/exynos_drm_fb.c +4
-1- nr =exynos_drm_format_num_buffers (fb->pixel_format); + exynos_fb->buf_cnt =exynos_drm_format_num_buffers (mode_cmd); + +DRM_DEBUG_KMS ("buf_cnt = %d\n" , exynos_fb->buf_cnt); - for (i = 1; i < nr; i++) { +for (i =1 ; i < exynos_fb->buf_cnt; i++) { obj =drm_gem_object_lookup (dev, file_priv, mode_cmd->handles[i]);if (!obj) {drivers/gpu/drm/exynos/exynos_drm_fb.h +6
-12@@ -28,19 +28,6 @@#ifndef _EXYNOS_DRM_FB_H_#define _EXYNOS_DRM_FB_H -static inline int exynos_drm_format_num_buffers(uint32_t format) -{ -switch (format) { -case DRM_FORMAT_NV12 : -case DRM_FORMAT_NV12MT : -return 2 ; -case DRM_FORMAT_YUV420 : -return 3 ; -default : -return 1 ; - } -} - struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -52,4 +39,11 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb, void exynos_drm_mode_config_init(struct drm_device *dev); +/* set a buffer count to drm framebuffer. */ +void exynos_drm_fb_set_buf_cnt(struct drm_framebuffer *fb, + unsigned int cnt); + +/* get a buffer count to drm framebuffer. */ +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb); +#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0
-0@@ -79,6 +79,9 @@ static int exynos_drm_fbdev_update(struct
drm_fb_helper
*helper,return -EFAULT; }+ /* buffer count to framebuffer always is 1 at booting time. */
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +2
-0+exynos_drm_fb_set_buf_cnt (fb,1 ); + offset = fbi->var.xoffset * (fb->bits_per_pixel >>3 ); offset += fbi->var.yoffset * fb->pitches[0 ]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index b89829e..777e142 100644drivers/gpu/drm/exynos/exynos_drm_plane.c +1
-0@@ -48,7 +48,7 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + nr =exynos_drm_fb_get_buf_cnt (fb);for (i =0 ; i < nr; i++) {Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_plane.c int exynos_plane_mode_set(struct drm_plane *plane, · line 54
Quoted 3 lines
drivers/gpu/drm/exynos/exynos_drm_plane.c +0
-0struct exynos_drm_gem_buf *buffer =exynos_drm_fb_buffer (fb, i);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
InKi Dae
maintainerRe: [PATCH 09/13] drm/exynos: check NV12M format specific to Exynos properly
sorry, again.
2012/8/20 InKi Dae <[email protected]>:
Quoted 126 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 115 lines · InKi Dae
Quoted 114 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 112 lines · Inki Dae
Quoted 94 lines
this patch adds
buf_cntvariable inexynos_drm_fbstructure and that means a buffer count to drm framebuffer and also adds two functions to get/set the buffer count from/toexynos_drm_fbstructure. if pixel format is notDRM_FORMAT_NV12MTthen it gets a buffer count to drm framebuffer refering tomode_cmd->handlesand offsets. but when booted, the buffer count will always be 1 because pixel format of console framebuffer is RGB format.Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 65 +++++++++++++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_fb.h | 20 +++------ drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 + drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- 4 files changed, 73 insertions(+), 17 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0@@ -41,10 +41,12 @@* exynos specific framebuffer structure. * * @fb: drm framebuffer obejct. +* @buf_cnt: a buffer count to drm framebuffer. * @exynos_gem_obj: array of exynos specific gem object containing a gem
object.*/ struct exynos_drm_fb { struct drm_framebuffer fb; + unsigned int buf_cnt; struct exynos_drm_gem_obj *exynos_gem_obj[MAX_FB_BUFFER]; }; @@ -101,6 +103,25 @@ static struct drm_framebuffer_funcs
exynos_drm_fb_funcs= {
.dirty =exynos_drm_fb_dirty,
};
+void exynos_drm_fb_set_buf_cnt(structdrm_framebuffer*fb,drivers/gpu/drm/exynos/exynos_drm_fb.c +43
-0+ unsigned int cnt) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + + exynos_fb->buf_cnt = cnt; +} + +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + +return exynos_fb->buf_cnt; +} +struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -127,6 +148,43 @@ exynos_drm_framebuffer_init(struct drm_device *dev,return &exynos_fb->fb; } +static u32 exynos_drm_format_num_buffers(struct drm_mode_fb_cmd2 *mode_cmd) +{ +unsigned int cnt =0 ; + +if (mode_cmd->pixel_format ==DRM_FORMAT_NV12MT ) +return 2 ; + +while (cnt !=MAX_FB_BUFFER ) { +if (!mode_cmd->handles[cnt]) +break ; + cnt++; + } + +/* +* check if NV12 or NV12M. +* +* NV12 +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base1, offsets[1] = Y_size +* +* NV12M +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base2, offsets[1] = 0 +*/ +if (cnt ==2 ) { +/* drivers/gpu/drm/exynos/exynos_drm_fb.c exynos_drm_framebuffer_init(struct drm_device *dev, · line 186
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +10
-0+* in case of NV12 format, offsets[1] is not 0 and +* handles[0] is same as handles[1]. +*/ +if (mode_cmd->offsets[1 ] && + mode_cmd->handles[0 ] == mode_cmd->handles[1 ]) + cnt =1 ; + } + +return cnt; +}No, please don't add specific function. There is already
drm_format_num_planes()functionQuoted 9 lines
Quoted 3 lines
I know that, but NV12M format is specific to Exynos. for this, we already had a discussion and you can refer to below link,
http://web.archiveorange.com/archive/v/hhSc5JAv767vo7fKZLPfYes, but this implementation is not clear, just get plane number using
drm_format_num_planes()
and check handle and offset argument when format is NV12.
Quoted 7 lines
drm_format_num_planes()doesn't include NV12MT format type so first that format should be added and then we can get plane count usingdrm_format_num_planesif not NV12. but if not,exynos_drm_format_num_buffers()like below,if (
mode_cmd==DRM_FORMAT_NV12)
if (mode_cmd->pixel_format == DRM_FORMAT_NV12)
exynos_fb->buf_cnt = exynos_drm_format_num_buffers(dev, ...);
else
exynos_fb->buf_cnt = drm_format_num_planes(....);Quoted 105 lines
Quoted 105 lines
Quoted 91 lines
Quoted 91 lines
Quoted 91 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0+static struct drm_framebuffer * exynos_user_fb_create(struct drm_device *dev, struct drm_file
*file_priv,
structdrm_mode_fb_cmd2*mode_cmd)drivers/gpu/drm/exynos/exynos_drm_fb.c +0
-1@@ -134,7 +192,6 @@ exynos_user_fb_create(struct drm_device *dev, structdrm_file *file_priv, struct drm_gem_object *obj;struct drm_framebuffer *fb;struct exynos_drm_fb *exynos_fb; -int nr;int i;DRM_DEBUG_KMS ("%s\n" , __FILE__);@@ -152,9 +209,11 @@ exynos_user_fb_create(struct drm_device *dev,struct
drm_file*file_priv,} exynos_fb = to_exynos_fb(fb);drivers/gpu/drm/exynos/exynos_drm_fb.c +4
-1- nr =exynos_drm_format_num_buffers (fb->pixel_format); + exynos_fb->buf_cnt =exynos_drm_format_num_buffers (mode_cmd); + +DRM_DEBUG_KMS ("buf_cnt = %d\n" , exynos_fb->buf_cnt); - for (i = 1; i < nr; i++) { +for (i =1 ; i < exynos_fb->buf_cnt; i++) { obj =drm_gem_object_lookup (dev, file_priv, mode_cmd->handles[i]);if (!obj) {drivers/gpu/drm/exynos/exynos_drm_fb.h +6
-12@@ -28,19 +28,6 @@#ifndef _EXYNOS_DRM_FB_H_#define _EXYNOS_DRM_FB_H -static inline int exynos_drm_format_num_buffers(uint32_t format) -{ -switch (format) { -case DRM_FORMAT_NV12 : -case DRM_FORMAT_NV12MT : -return 2 ; -case DRM_FORMAT_YUV420 : -return 3 ; -default : -return 1 ; - } -} - struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -52,4 +39,11 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb, void exynos_drm_mode_config_init(struct drm_device *dev); +/* set a buffer count to drm framebuffer. */ +void exynos_drm_fb_set_buf_cnt(struct drm_framebuffer *fb, + unsigned int cnt); + +/* get a buffer count to drm framebuffer. */ +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb); +#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0
-0@@ -79,6 +79,9 @@ static int exynos_drm_fbdev_update(struct
drm_fb_helper
*helper,return -EFAULT; }+ /* buffer count to framebuffer always is 1 at booting time. */
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +2
-0+exynos_drm_fb_set_buf_cnt (fb,1 ); + offset = fbi->var.xoffset * (fb->bits_per_pixel >>3 ); offset += fbi->var.yoffset * fb->pitches[0 ]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index b89829e..777e142 100644drivers/gpu/drm/exynos/exynos_drm_plane.c +1
-0@@ -48,7 +48,7 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + nr =exynos_drm_fb_get_buf_cnt (fb);for (i =0 ; i < nr; i++) {Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_plane.c int exynos_plane_mode_set(struct drm_plane *plane, · line 54
Quoted 3 lines
drivers/gpu/drm/exynos/exynos_drm_plane.c +0
-0struct exynos_drm_gem_buf *buffer =exynos_drm_fb_buffer (fb, i);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/13] drm/exynos: check NV12M format specific to Exynos properly
Quoted 128 lines · InKi Dae
sorry, again.
2012/8/20 InKi Dae <[email protected]>:
Quoted 125 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 111 lines · InKi Dae
Quoted 110 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 109 lines · Inki Dae
Quoted 93 lines
this patch adds
buf_cntvariable inexynos_drm_fbstructure and that means a buffer count to drm framebuffer and also adds two functions to get/set the buffer count from/toexynos_drm_fbstructure. if pixel format is notDRM_FORMAT_NV12MTthen it gets a buffer count to drm framebuffer refering tomode_cmd->handlesand offsets. but when booted, the buffer count will always be 1 because pixel format of console framebuffer is RGB format.Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 65 +++++++++++++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_fb.h | 20 +++------ drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 + drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- 4 files changed, 73 insertions(+), 17 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0@@ -41,10 +41,12 @@* exynos specific framebuffer structure. * * @fb: drm framebuffer obejct. +* @buf_cnt: a buffer count to drm framebuffer. * @exynos_gem_obj: array of exynos specific gem object containing a gem
object.*/ struct exynos_drm_fb { struct drm_framebuffer fb; + unsigned int buf_cnt; struct exynos_drm_gem_obj *exynos_gem_obj[MAX_FB_BUFFER]; }; @@ -101,6 +103,25 @@ static struct drm_framebuffer_funcs
exynos_drm_fb_funcs= {
.dirty =exynos_drm_fb_dirty,
};
+void exynos_drm_fb_set_buf_cnt(structdrm_framebuffer*fb,drivers/gpu/drm/exynos/exynos_drm_fb.c +43
-0+ unsigned int cnt) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + + exynos_fb->buf_cnt = cnt; +} + +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + +return exynos_fb->buf_cnt; +} +struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -127,6 +148,43 @@ exynos_drm_framebuffer_init(struct drm_device *dev,return &exynos_fb->fb; } +static u32 exynos_drm_format_num_buffers(struct drm_mode_fb_cmd2 *mode_cmd) +{ +unsigned int cnt =0 ; + +if (mode_cmd->pixel_format ==DRM_FORMAT_NV12MT ) +return 2 ; + +while (cnt !=MAX_FB_BUFFER ) { +if (!mode_cmd->handles[cnt]) +break ; + cnt++; + } + +/* +* check if NV12 or NV12M. +* +* NV12 +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base1, offsets[1] = Y_size +* +* NV12M +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base2, offsets[1] = 0 +*/ +if (cnt ==2 ) { +/* drivers/gpu/drm/exynos/exynos_drm_fb.c exynos_drm_framebuffer_init(struct drm_device *dev, · line 186
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +10
-0+* in case of NV12 format, offsets[1] is not 0 and +* handles[0] is same as handles[1]. +*/ +if (mode_cmd->offsets[1 ] && + mode_cmd->handles[0 ] == mode_cmd->handles[1 ]) + cnt =1 ; + } + +return cnt; +}No, please don't add specific function. There is already
drm_format_num_planes()functionQuoted 8 lines
Quoted 3 lines
I know that, but NV12M format is specific to Exynos. for this, we already had a discussion and you can refer to below link,
http://web.archiveorange.com/archive/v/hhSc5JAv767vo7fKZLPfYes, but this implementation is not clear, just get plane number using
drm_format_num_planes()
and check handle and offset argument when format is NV12.
drm_format_num_planes()doesn't include NV12MT format type so first that format should be added and then we can get plane count usingdrm_format_num_planesif not NV12. but if not,exynos_drm_format_num_buffers()like below,
Quoted 6 lines
Quoted 2 lines
if (
mode_cmd==DRM_FORMAT_NV12)if (
mode_cmd->pixel_format==DRM_FORMAT_NV12)exynos_fb->buf_cnt = exynos_drm_format_num_buffers(dev, ...); else exynos_fb->buf_cnt = drm_format_num_planes(....);
I think that just reuse exynos_drm_format_num_buffers(), and call drm_format_num_planes() and check NV12 format in that function.
Quoted 101 lines
Quoted 101 lines
Quoted 101 lines
Quoted 88 lines
Quoted 88 lines
Quoted 88 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0+static struct drm_framebuffer * exynos_user_fb_create(struct drm_device *dev, struct drm_file
*file_priv,
structdrm_mode_fb_cmd2*mode_cmd)drivers/gpu/drm/exynos/exynos_drm_fb.c +0
-1@@ -134,7 +192,6 @@ exynos_user_fb_create(struct drm_device *dev, structdrm_file *file_priv, struct drm_gem_object *obj;struct drm_framebuffer *fb;struct exynos_drm_fb *exynos_fb; -int nr;int i;DRM_DEBUG_KMS ("%s\n" , __FILE__);@@ -152,9 +209,11 @@ exynos_user_fb_create(struct drm_device *dev,struct
drm_file*file_priv,} exynos_fb = to_exynos_fb(fb);drivers/gpu/drm/exynos/exynos_drm_fb.c +4
-1- nr =exynos_drm_format_num_buffers (fb->pixel_format); + exynos_fb->buf_cnt =exynos_drm_format_num_buffers (mode_cmd); + +DRM_DEBUG_KMS ("buf_cnt = %d\n" , exynos_fb->buf_cnt); - for (i = 1; i < nr; i++) { +for (i =1 ; i < exynos_fb->buf_cnt; i++) { obj =drm_gem_object_lookup (dev, file_priv, mode_cmd->handles[i]);if (!obj) {drivers/gpu/drm/exynos/exynos_drm_fb.h +6
-12@@ -28,19 +28,6 @@#ifndef _EXYNOS_DRM_FB_H_#define _EXYNOS_DRM_FB_H -static inline int exynos_drm_format_num_buffers(uint32_t format) -{ -switch (format) { -case DRM_FORMAT_NV12 : -case DRM_FORMAT_NV12MT : -return 2 ; -case DRM_FORMAT_YUV420 : -return 3 ; -default : -return 1 ; - } -} - struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -52,4 +39,11 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb, void exynos_drm_mode_config_init(struct drm_device *dev); +/* set a buffer count to drm framebuffer. */ +void exynos_drm_fb_set_buf_cnt(struct drm_framebuffer *fb, + unsigned int cnt); + +/* get a buffer count to drm framebuffer. */ +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb); +#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0
-0@@ -79,6 +79,9 @@ static int exynos_drm_fbdev_update(struct
drm_fb_helper
*helper,return -EFAULT; } + /* buffer count to framebuffer always is 1 at booting time. */drivers/gpu/drm/exynos/exynos_drm_fbdev.c +2
-0+exynos_drm_fb_set_buf_cnt (fb,1 ); + offset = fbi->var.xoffset * (fb->bits_per_pixel >>3 ); offset += fbi->var.yoffset * fb->pitches[0 ]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index b89829e..777e142 100644drivers/gpu/drm/exynos/exynos_drm_plane.c +1
-0@@ -48,7 +48,7 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + nr =exynos_drm_fb_get_buf_cnt (fb);Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_plane.c int exynos_plane_mode_set(struct drm_plane *plane, · line 54
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_plane.c +0
-0for (i =0 ; i < nr; i++) {struct exynos_drm_gem_buf *buffer =exynos_drm_fb_buffer (fb, i);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
InKi Dae
maintainerRe: [PATCH 09/13] drm/exynos: check NV12M format specific to Exynos properly
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 143 lines · InKi Dae
Quoted 142 lines
sorry, again.
2012/8/20 InKi Dae <[email protected]>:
Quoted 138 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 120 lines · InKi Dae
Quoted 118 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 116 lines · Inki Dae
Quoted 98 lines
this patch adds
buf_cntvariable inexynos_drm_fbstructure and that means a buffer count to drm framebuffer and also adds two functions to get/set the buffer count from/toexynos_drm_fbstructure.
if pixel format is notDRM_FORMAT_NV12MTthen it gets a buffer count to drm framebuffer refering tomode_cmd->handlesand offsets. but when booted, the buffer count will always be 1 because pixel format of console framebuffer is RGB format.Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 65 +++++++++++++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_fb.h | 20 +++------ drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 + drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- 4 files changed, 73 insertions(+), 17 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0@@ -41,10 +41,12 @@* exynos specific framebuffer structure. * * @fb: drm framebuffer obejct. +* @buf_cnt: a buffer count to drm framebuffer. * @exynos_gem_obj: array of exynos specific gem object containing a
gem
object.*/ struct exynos_drm_fb { struct drm_framebuffer fb; + unsigned int buf_cnt; struct exynos_drm_gem_obj *exynos_gem_obj[MAX_FB_BUFFER]; }; @@ -101,6 +103,25 @@ static struct drm_framebuffer_funcs
exynos_drm_fb_funcs= {
.dirty =exynos_drm_fb_dirty,
};
+void exynos_drm_fb_set_buf_cnt(structdrm_framebuffer*fb,drivers/gpu/drm/exynos/exynos_drm_fb.c +43
-0+ unsigned int cnt) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + + exynos_fb->buf_cnt = cnt; +} + +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb) +{ +struct exynos_drm_fb *exynos_fb; + + exynos_fb =to_exynos_fb (fb); + +return exynos_fb->buf_cnt; +} +struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -127,6 +148,43 @@ exynos_drm_framebuffer_init(struct drm_device *dev, return &exynos_fb->fb; } +static u32 exynos_drm_format_num_buffers(struct drm_mode_fb_cmd2 *mode_cmd) +{ +unsigned int cnt =0 ; + +if (mode_cmd->pixel_format ==DRM_FORMAT_NV12MT ) +return 2 ; + +while (cnt !=MAX_FB_BUFFER ) { +if (!mode_cmd->handles[cnt]) +break ; + cnt++; + } + +/* +* check if NV12 or NV12M. +* +* NV12 +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base1, offsets[1] = Y_size +* +* NV12M +* handles[0] = base1, offsets[0] = 0 +* handles[1] = base2, offsets[1] = 0 +*/ +if (cnt ==2 ) { +/* drivers/gpu/drm/exynos/exynos_drm_fb.c exynos_drm_framebuffer_init(struct drm_device · line 187
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +10
-0+* in case of NV12 format, offsets[1] is not 0 and +* handles[0] is same as handles[1]. +*/ +if (mode_cmd->offsets[1 ] && + mode_cmd->handles[0 ] == mode_cmd->handles[1 ]) + cnt =1 ; + } + +return cnt; +}No, please don't add specific function. There is already
drm_format_num_planes()functionQuoted 9 lines
Quoted 3 lines
I know that, but NV12M format is specific to Exynos. for this, we already had a discussion and you can refer to below link,
http://web.archiveorange.com/archive/v/hhSc5JAv767vo7fKZLPfYes, but this implementation is not clear, just get plane number using
drm_format_num_planes()
and check handle and offset argument when format is NV12.
drm_format_num_planes()doesn't include NV12MT format type so first that format should be added and then we can get plane count usingdrm_format_num_planesif not NV12. but if not,exynos_drm_format_num_buffers()like below,if (
mode_cmd==DRM_FORMAT_NV12)
Quoted 9 lines
Quoted 4 lines
if (
mode_cmd->pixel_format==DRM_FORMAT_NV12)exynos_fb->buf_cnt = exynos_drm_format_num_buffers(dev, ...); else exynos_fb->buf_cnt = drm_format_num_planes(....);I think that just reuse
exynos_drm_format_num_buffers(), and calldrm_format_num_planes()and check NV12 format in that function.
Okey~
Quoted 111 lines
Quoted 101 lines
Quoted 101 lines
Quoted 101 lines
Quoted 99 lines
Quoted 99 lines
Quoted 88 lines
drivers/gpu/drm/exynos/exynos_drm_fb.c +1
-0+static struct drm_framebuffer * exynos_user_fb_create(struct drm_device *dev, struct drm_file
*file_priv,
structdrm_mode_fb_cmd2*mode_cmd)drivers/gpu/drm/exynos/exynos_drm_fb.c +0
-0@@ -134,7 +192,6 @@ exynos_user_fb_create(struct drm_device *dev,struct
drm_file*file_priv,struct drm_gem_object *obj; struct drm_framebuffer *fb; struct exynos_drm_fb *exynos_fb;drivers/gpu/drm/exynos/exynos_drm_fb.c +0
-1-int nr;int i;DRM_DEBUG_KMS ("%s\n" , __FILE__);@@ -152,9 +209,11 @@ exynos_user_fb_create(struct drm_device *dev,struct
drm_file*file_priv,} exynos_fb = to_exynos_fb(fb);drivers/gpu/drm/exynos/exynos_drm_fb.c +4
-1- nr =exynos_drm_format_num_buffers (fb->pixel_format); + exynos_fb->buf_cnt =exynos_drm_format_num_buffers (mode_cmd); + +DRM_DEBUG_KMS ("buf_cnt = %d\n" , exynos_fb->buf_cnt); - for (i = 1; i < nr; i++) { +for (i =1 ; i < exynos_fb->buf_cnt; i++) { obj =drm_gem_object_lookup (dev, file_priv, mode_cmd->handles[i]);if (!obj) {drivers/gpu/drm/exynos/exynos_drm_fb.h +6
-12@@ -28,19 +28,6 @@#ifndef _EXYNOS_DRM_FB_H_#define _EXYNOS_DRM_FB_H -static inline int exynos_drm_format_num_buffers(uint32_t format) -{ -switch (format) { -case DRM_FORMAT_NV12 : -case DRM_FORMAT_NV12MT : -return 2 ; -case DRM_FORMAT_YUV420 : -return 3 ; -default : -return 1 ; - } -} - struct drm_framebuffer * exynos_drm_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd2 *mode_cmd,@@ -52,4 +39,11 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb, void exynos_drm_mode_config_init(struct drm_device *dev); +/* set a buffer count to drm framebuffer. */ +void exynos_drm_fb_set_buf_cnt(struct drm_framebuffer *fb, + unsigned int cnt); + +/* get a buffer count to drm framebuffer. */ +unsigned int exynos_drm_fb_get_buf_cnt (struct drm_framebuffer *fb); +#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0
-0@@ -79,6 +79,9 @@ static int exynos_drm_fbdev_update(struct
drm_fb_helper
*helper,return -EFAULT; } + /* buffer count to framebuffer always is 1 at booting time.*/
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +2
-0+exynos_drm_fb_set_buf_cnt (fb,1 ); + offset = fbi->var.xoffset * (fb->bits_per_pixel >>3 ); offset += fbi->var.yoffset * fb->pitches[0 ]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index b89829e..777e142 100644drivers/gpu/drm/exynos/exynos_drm_plane.c int exynos_plane_mode_set(struct drm_plane *plane, · line 54
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_plane.c +1
-0@@ -48,7 +48,7 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); - nr =exynos_drm_format_num_buffers (fb->pixel_format); + nr =exynos_drm_fb_get_buf_cnt (fb);for (i =0 ; i < nr; i++) {struct exynos_drm_gem_buf *buffer =exynos_drm_fb_buffer (fb, i);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-develQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerPATCH 10/13 drm/exynos: update crtc to plane safely
In reply to Inki Daeif old_crtc isn't same as encoder->crtc then it means that user changed crtc id to another one so a plane to old_crtc should be disabled so that current plane can be updated safely and plane->crtc should be set to new crtc(encoder->crtc)
--- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 59 +++++++++++++++++++++++++- 1 files changed, 56 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_encoder.c +56 -3
@@ -44,6 +44,7 @@* @dpms: store the encoder dpms value. */ struct exynos_drm_encoder { +struct drm_crtc *old_crtc;struct drm_encoder drm_encoder;struct exynos_drm_manager *manager;int dpms;
@@ -106,22 +107,74 @@ exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder,return true; } +static void disable_plane_to_crtc (struct drm_device *dev, +struct drm_crtc *old_crtc, +struct drm_crtc *new_crtc) +{ +struct drm_plane *plane; + +/* +* if old_crtc isn't same as encoder->crtc then it means that +* user changed crtc id to another one so the plane to old_crtc +* should be disabled and plane->crtc should be set to new_crtc +* (encoder->crtc) +*/ +list_for_each_entry (plane, &dev->mode_config.plane_list, head) { +if (plane->crtc == old_crtc) { +/* +* do not change below call order. +* +* plane->funcs->disable_plane call checks +* if encoder->crtc is same as plane->crtc and if same +* then overlay_ops->disable callback will be called +* to diasble current hw overlay so plane->crtc should +* have new_crtc because new_crtc was set to +* encoder->crtc in advance. +*/ + plane->crtc = new_crtc; + plane->funcs->disable_plane (plane); + } + } +} +static void exynos_drm_encoder_mode_set (struct drm_encoder *encoder,struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct drm_device *dev = encoder->dev;struct drm_connector *connector; -struct exynos_drm_manager *manager =exynos_drm_get_manager (encoder); -struct exynos_drm_manager_ops *manager_ops = manager->ops; +struct exynos_drm_manager *manager; +struct exynos_drm_manager_ops *manager_ops;DRM_DEBUG_KMS ("%s\n" , __FILE__);list_for_each_entry (connector, &dev->mode_config.connector_list, head) { -if (connector->encoder == encoder) +if (connector->encoder == encoder) { +struct exynos_drm_encoder *exynos_encoder; + + exynos_encoder =to_exynos_encoder (encoder); + +if (exynos_encoder->old_crtc != encoder->crtc && + exynos_encoder->old_crtc) { + +/* +* disable a plane to old crtc and change +* crtc of the plane to new one. +*/ +disable_plane_to_crtc (dev, + exynos_encoder->old_crtc, + encoder->crtc); + } + + manager =exynos_drm_get_manager (encoder); + manager_ops = manager->ops; +if (manager_ops && manager_ops->mode_set) manager_ops->mode_set (manager->dev, adjusted_mode); + + exynos_encoder->old_crtc = encoder->crtc; + } } }
Signature · 1 line
1.7.4.1
Re: [PATCH 10/13] drm/exynos: update crtc to plane safely
Quoted 66 lines · Inki Dae
if
old_crtcisn't same asencoder->crtcthen it means that user changed crtc id to another one so a plane toold_crtcshould be disabled so that current plane can be updated safely andplane->crtcshould be set to newcrtc(encoder->crtc)Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 59 +++++++++++++++++++++++++- 1 files changed, 56 insertions(+), 3 deletions(-)drivers/gpu/drm/exynos/exynos_drm_encoder.c +32
-2@@ -44,6 +44,7 @@* @dpms: store the encoder dpms value. */ struct exynos_drm_encoder { +struct drm_crtc *old_crtc;struct drm_encoder drm_encoder;struct exynos_drm_manager *manager;int dpms;@@ -106,22 +107,74 @@ exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder,return true; } +static void disable_plane_to_crtc (struct drm_device *dev, +struct drm_crtc *old_crtc, +struct drm_crtc *new_crtc) +{ +struct drm_plane *plane; + +/* +* if old_crtc isn't same as encoder->crtc then it means that +* user changed crtc id to another one so the plane to old_crtc +* should be disabled and plane->crtc should be set to new_crtc +* (encoder->crtc) +*/ +list_for_each_entry (plane, &dev->mode_config.plane_list, head) { +if (plane->crtc == old_crtc) { +/* +* do not change below call order. +* +* plane->funcs->disable_plane call checks +* if encoder->crtc is same as plane->crtc and if same +* then overlay_ops->disable callback will be called +* to diasble current hw overlay so plane->crtc should +* have new_crtc because new_crtc was set to +* encoder->crtc in advance. +*/ + plane->crtc = new_crtc; + plane->funcs->disable_plane (plane); + } + } +} +static void exynos_drm_encoder_mode_set (struct drm_encoder *encoder,struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct drm_device *dev = encoder->dev;struct drm_connector *connector; -struct exynos_drm_manager *manager =exynos_drm_get_manager (encoder); -struct exynos_drm_manager_ops *manager_ops = manager->ops; +struct exynos_drm_manager *manager;
drivers/gpu/drm/exynos/exynos_drm_encoder.c exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder, · line 155
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_encoder.c +5
-1+struct exynos_drm_manager_ops *manager_ops;DRM_DEBUG_KMS ("%s\n" , __FILE__);list_for_each_entry (connector, &dev->mode_config.connector_list, head) { -if (connector->encoder == encoder) +if (connector->encoder == encoder) { +struct exynos_drm_encoder *exynos_encoder; + + exynos_encoder =to_exynos_encoder (encoder);
Does needs to do this in for statement?
Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_encoder.c +5
-0+ +if (exynos_encoder->old_crtc != encoder->crtc && + exynos_encoder->old_crtc) { + +/*
drivers/gpu/drm/exynos/exynos_drm_encoder.c exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder, · line 170
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_encoder.c +10
-0+* disable a plane to old crtc and change +* crtc of the plane to new one. +*/ +disable_plane_to_crtc (dev, + exynos_encoder->old_crtc, + encoder->crtc); + } + + manager =exynos_drm_get_manager (encoder); + manager_ops = manager->ops;
Does needs to do this in for statement?
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_encoder.c +4
-0+if (manager_ops && manager_ops->mode_set) manager_ops->mode_set (manager->dev, adjusted_mode); + + exynos_encoder->old_crtc = encoder->crtc; + } } }
Inki Dae
maintainerPATCH 11/13 drm/exynos: changed context name of hdmi and mixer
In reply to Inki Daethis patch changes ctx variable name in exynos_drm_hdmi_context structure to client because the use of ctx variable makes it confused.
--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 38 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++++---- drivers/gpu/drm/exynos/exynos_mixer.c | 8 +++--- 4 files changed, 31 insertions(+), 31 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_hdmi.c +19 -19
@@ -64,7 +64,7 @@ static bool drm_hdmi_is_connected(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->is_connected) -return hdmi_ops->is_connected (ctx->hdmi_ctx->ctx); +return hdmi_ops->is_connected (ctx->hdmi_ctx->client);return false; }
@@ -77,8 +77,8 @@ static int drm_hdmi_get_edid(struct device *dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_edid) -return hdmi_ops->get_edid (ctx->hdmi_ctx->ctx, connector, edid, - len); +return hdmi_ops->get_edid (ctx->hdmi_ctx->client, connector, + edid, len);return 0 ; }
@@ -90,7 +90,7 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->check_timing) -return hdmi_ops->check_timing (ctx->hdmi_ctx->ctx, timing); +return hdmi_ops->check_timing (ctx->hdmi_ctx->client, timing);return 0 ; }
@@ -102,7 +102,7 @@ static int drm_hdmi_power_on(struct device *dev, int mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->power_on) -return hdmi_ops->power_on (ctx->hdmi_ctx->ctx, mode); +return hdmi_ops->power_on (ctx->hdmi_ctx->client, mode);return 0 ; }
@@ -124,7 +124,7 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->enable_vblank) -return mixer_ops->enable_vblank (ctx->mixer_ctx->ctx, +return mixer_ops->enable_vblank (ctx->mixer_ctx->client, manager->pipe);return 0 ;
@@ -137,12 +137,12 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->disable_vblank) -return mixer_ops->disable_vblank (ctx->mixer_ctx->ctx); +return mixer_ops->disable_vblank (ctx->mixer_ctx->client); }static void drm_hdmi_mode_fixup (struct device *subdrv_dev,struct drm_connector *connector, -const struct drm_display_mode *mode, +struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct drm_hdmi_context *ctx =to_context (subdrv_dev);
@@ -150,7 +150,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_fixup) - hdmi_ops->mode_fixup (ctx->hdmi_ctx->ctx, connector, mode, + hdmi_ops->mode_fixup (ctx->hdmi_ctx->client, connector, mode, adjusted_mode); }
@@ -161,7 +161,7 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_set) - hdmi_ops->mode_set (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->mode_set (ctx->hdmi_ctx->client, mode); } static void drm_hdmi_get_max_resol(struct device *subdrv_dev,
@@ -172,7 +172,7 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_max_resol) - hdmi_ops->get_max_resol (ctx->hdmi_ctx->ctx, width, height); + hdmi_ops->get_max_resol (ctx->hdmi_ctx->client, width, height); }static void drm_hdmi_commit (struct device *subdrv_dev)
@@ -182,7 +182,7 @@ static void drm_hdmi_commit(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static void drm_hdmi_dpms (struct device *subdrv_dev,int mode)
@@ -192,10 +192,10 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->dpms) - mixer_ops->dpms (ctx->mixer_ctx->ctx, mode); + mixer_ops->dpms (ctx->mixer_ctx->client, mode);if (hdmi_ops && hdmi_ops->dpms) - hdmi_ops->dpms (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->dpms (ctx->hdmi_ctx->client, mode); }static void drm_hdmi_apply (struct device *subdrv_dev)
@@ -209,11 +209,11 @@ static void drm_hdmi_apply(struct device *subdrv_dev)if (!ctx->enabled[i])continue ;if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, i); + mixer_ops->win_commit (ctx->mixer_ctx->client, i); }if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {
@@ -235,7 +235,7 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->win_mode_set) - mixer_ops->win_mode_set (ctx->mixer_ctx->ctx, overlay); + mixer_ops->win_mode_set (ctx->mixer_ctx->client, overlay); }static void drm_mixer_commit (struct device *subdrv_dev,int zpos)
@@ -251,7 +251,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, win); + mixer_ops->win_commit (ctx->mixer_ctx->client, win); ctx->enabled[win] = true; }
@@ -269,7 +269,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_disable) - mixer_ops->win_disable (ctx->mixer_ctx->ctx, win); + mixer_ops->win_disable (ctx->mixer_ctx->client, win); ctx->enabled[win] = false; }
drivers/gpu/drm/exynos/exynos_drm_hdmi.h +2 -2
@@ -33,12 +33,12 @@* exynos hdmi common context structure. * * @drm_dev: pointer to drm_device. -* @ctx: pointer to the context of specific device driver. +* @client: pointer to the context of specific device driver. * this context should be hdmi_context or mixer_context. */ struct exynos_drm_hdmi_context {struct drm_device *drm_dev; -void *ctx; +void *client; };struct exynos_hdmi_ops {
drivers/gpu/drm/exynos/exynos_hdmi.c +6 -6
@@ -2108,7 +2108,7 @@ static struct exynos_hdmi_ops hdmi_ops = {static irqreturn_t hdmi_external_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;if (!hdata->get_hpd) goto out;
@@ -2127,7 +2127,7 @@ out:static irqreturn_t hdmi_internal_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;u32 intc_flag; intc_flag =hdmi_reg_read (hdata,HDMI_INTC_FLAG );
@@ -2295,7 +2295,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev)mutex_init (&hdata->hdmi_mutex); - drm_hdmi_ctx->ctx = (void *)hdata; + drm_hdmi_ctx->client = (void *)hdata; hdata->parent_ctx = (void *)drm_hdmi_ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);
@@ -2395,7 +2395,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct exynos_drm_hdmi_context *ctx =platform_get_drvdata (pdev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);
@@ -2417,7 +2417,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev)static int hdmi_suspend (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;disable_irq (hdata->internal_irq);disable_irq (hdata->external_irq);
@@ -2434,7 +2434,7 @@ static int hdmi_suspend(struct device *dev)static int hdmi_resume (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;enable_irq (hdata->external_irq);enable_irq (hdata->internal_irq);
drivers/gpu/drm/exynos/exynos_mixer.c +4 -4
@@ -864,7 +864,7 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)static irqreturn_t mixer_irq_handler (int irq,void *arg) {struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg; -struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;struct mixer_resources *res = &ctx->mixer_res;u32 val, base, shadow;
@@ -909,7 +909,7 @@ out:static int __devinit mixer_resources_init (struct exynos_drm_hdmi_context *ctx,struct platform_device *pdev) { -struct mixer_context *mixer_ctx = ctx->ctx; +struct mixer_context *mixer_ctx = ctx->client;struct device *dev = &pdev->dev;struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;struct resource *res;
@@ -1035,7 +1035,7 @@ static int __devinit mixer_probe(struct platform_device *pdev)mutex_init (&ctx->mixer_mutex); ctx->dev = &pdev->dev; - drm_hdmi_ctx->ctx = (void *)ctx; + drm_hdmi_ctx->client = (void *)ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);
@@ -1070,7 +1070,7 @@ static int mixer_remove(struct platform_device *pdev)static int mixer_suspend (struct device *dev) {struct exynos_drm_hdmi_context *drm_hdmi_ctx =get_mixer_context (dev); -struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;mixer_poweroff (ctx);
Signature · 1 line
1.7.4.1
Re: [PATCH 11/13] drm/exynos: changed context name of hdmi and mixer
Quoted 2 lines · Inki Dae
this patch changes ctx variable name in
exynos_drm_hdmi_contextstructure to client because the use of ctx variable makes it confused.
I don't prefer "client" name. This is not client and server relationship.
Quoted 283 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 38 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++++---- drivers/gpu/drm/exynos/exynos_mixer.c | 8 +++--- 4 files changed, 31 insertions(+), 31 deletions(-)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +19
-19@@ -64,7 +64,7 @@ static bool drm_hdmi_is_connected(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->is_connected) -return hdmi_ops->is_connected (ctx->hdmi_ctx->ctx); +return hdmi_ops->is_connected (ctx->hdmi_ctx->client);return false; }@@ -77,8 +77,8 @@ static int drm_hdmi_get_edid(struct device *dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_edid) -return hdmi_ops->get_edid (ctx->hdmi_ctx->ctx, connector, edid, - len); +return hdmi_ops->get_edid (ctx->hdmi_ctx->client, connector, + edid, len);return 0 ; }@@ -90,7 +90,7 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->check_timing) -return hdmi_ops->check_timing (ctx->hdmi_ctx->ctx, timing); +return hdmi_ops->check_timing (ctx->hdmi_ctx->client, timing);return 0 ; }@@ -102,7 +102,7 @@ static int drm_hdmi_power_on(struct device *dev, int mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->power_on) -return hdmi_ops->power_on (ctx->hdmi_ctx->ctx, mode); +return hdmi_ops->power_on (ctx->hdmi_ctx->client, mode);return 0 ; }@@ -124,7 +124,7 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->enable_vblank) -return mixer_ops->enable_vblank (ctx->mixer_ctx->ctx, +return mixer_ops->enable_vblank (ctx->mixer_ctx->client, manager->pipe);return 0 ;@@ -137,12 +137,12 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->disable_vblank) -return mixer_ops->disable_vblank (ctx->mixer_ctx->ctx); +return mixer_ops->disable_vblank (ctx->mixer_ctx->client); }static void drm_hdmi_mode_fixup (struct device *subdrv_dev,struct drm_connector *connector, -const struct drm_display_mode *mode, +struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct drm_hdmi_context *ctx =to_context (subdrv_dev);@@ -150,7 +150,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_fixup) - hdmi_ops->mode_fixup (ctx->hdmi_ctx->ctx, connector, mode, + hdmi_ops->mode_fixup (ctx->hdmi_ctx->client, connector, mode, adjusted_mode); }@@ -161,7 +161,7 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_set) - hdmi_ops->mode_set (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->mode_set (ctx->hdmi_ctx->client, mode); } static void drm_hdmi_get_max_resol(struct device *subdrv_dev,@@ -172,7 +172,7 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_max_resol) - hdmi_ops->get_max_resol (ctx->hdmi_ctx->ctx, width, height); + hdmi_ops->get_max_resol (ctx->hdmi_ctx->client, width, height); }static void drm_hdmi_commit (struct device *subdrv_dev)@@ -182,7 +182,7 @@ static void drm_hdmi_commit(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static void drm_hdmi_dpms (struct device *subdrv_dev,int mode)@@ -192,10 +192,10 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->dpms) - mixer_ops->dpms (ctx->mixer_ctx->ctx, mode); + mixer_ops->dpms (ctx->mixer_ctx->client, mode);if (hdmi_ops && hdmi_ops->dpms) - hdmi_ops->dpms (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->dpms (ctx->hdmi_ctx->client, mode); }static void drm_hdmi_apply (struct device *subdrv_dev)@@ -209,11 +209,11 @@ static void drm_hdmi_apply(struct device *subdrv_dev)if (!ctx->enabled[i])continue ;if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, i); + mixer_ops->win_commit (ctx->mixer_ctx->client, i); }if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {@@ -235,7 +235,7 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->win_mode_set) - mixer_ops->win_mode_set (ctx->mixer_ctx->ctx, overlay); + mixer_ops->win_mode_set (ctx->mixer_ctx->client, overlay); }static void drm_mixer_commit (struct device *subdrv_dev,int zpos)@@ -251,7 +251,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, win); + mixer_ops->win_commit (ctx->mixer_ctx->client, win); ctx->enabled[win] = true; }@@ -269,7 +269,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_disable) - mixer_ops->win_disable (ctx->mixer_ctx->ctx, win); + mixer_ops->win_disable (ctx->mixer_ctx->client, win); ctx->enabled[win] = false; }drivers/gpu/drm/exynos/exynos_drm_hdmi.h +2
-2@@ -33,12 +33,12 @@* exynos hdmi common context structure. * * @drm_dev: pointer to drm_device. -* @ctx: pointer to the context of specific device driver. +* @client: pointer to the context of specific device driver. * this context should be hdmi_context or mixer_context. */ struct exynos_drm_hdmi_context {struct drm_device *drm_dev; -void *ctx; +void *client; };struct exynos_hdmi_ops {drivers/gpu/drm/exynos/exynos_hdmi.c +6
-6@@ -2108,7 +2108,7 @@ static struct exynos_hdmi_ops hdmi_ops = {static irqreturn_t hdmi_external_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;if (!hdata->get_hpd) goto out;@@ -2127,7 +2127,7 @@ out:static irqreturn_t hdmi_internal_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;u32 intc_flag; intc_flag =hdmi_reg_read (hdata,HDMI_INTC_FLAG );@@ -2295,7 +2295,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev)mutex_init (&hdata->hdmi_mutex); - drm_hdmi_ctx->ctx = (void *)hdata; + drm_hdmi_ctx->client = (void *)hdata; hdata->parent_ctx = (void *)drm_hdmi_ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);@@ -2395,7 +2395,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct exynos_drm_hdmi_context *ctx =platform_get_drvdata (pdev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);@@ -2417,7 +2417,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev)static int hdmi_suspend (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;disable_irq (hdata->internal_irq);disable_irq (hdata->external_irq);@@ -2434,7 +2434,7 @@ static int hdmi_suspend(struct device *dev)static int hdmi_resume (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;enable_irq (hdata->external_irq);enable_irq (hdata->internal_irq);drivers/gpu/drm/exynos/exynos_mixer.c +4
-4@@ -864,7 +864,7 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)static irqreturn_t mixer_irq_handler (int irq,void *arg) {struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg; -struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;struct mixer_resources *res = &ctx->mixer_res;u32 val, base, shadow;@@ -909,7 +909,7 @@ out:static int __devinit mixer_resources_init (struct exynos_drm_hdmi_context *ctx,struct platform_device *pdev) { -struct mixer_context *mixer_ctx = ctx->ctx; +struct mixer_context *mixer_ctx = ctx->client;struct device *dev = &pdev->dev;struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;struct resource *res;@@ -1035,7 +1035,7 @@ static int __devinit mixer_probe(struct platform_device *pdev)mutex_init (&ctx->mixer_mutex); ctx->dev = &pdev->dev; - drm_hdmi_ctx->ctx = (void *)ctx; + drm_hdmi_ctx->client = (void *)ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);@@ -1070,7 +1070,7 @@ static int mixer_remove(struct platform_device *pdev)static int mixer_suspend (struct device *dev) {struct exynos_drm_hdmi_context *drm_hdmi_ctx =get_mixer_context (dev); -struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;mixer_poweroff (ctx);
InKi Dae
maintainerRe: [PATCH 11/13] drm/exynos: changed context name of hdmi and mixer
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 8 lines · Inki Dae
Quoted 3 lines
this patch changes ctx variable name in
exynos_drm_hdmi_contextstructure to client because the use of ctx variable makes it confused.I don't prefer "client" name. This is not client and server relationship.
Okay, give me your opinion. which one do you prefer?
Quoted 275 lines
Quoted 266 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 38 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++++---- drivers/gpu/drm/exynos/exynos_mixer.c | 8 +++--- 4 files changed, 31 insertions(+), 31 deletions(-)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +9
-9@@ -64,7 +64,7 @@ static bool drm_hdmi_is_connected(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->is_connected) -return hdmi_ops->is_connected (ctx->hdmi_ctx->ctx); +return hdmi_ops->is_connected (ctx->hdmi_ctx->client);return false; }@@ -77,8 +77,8 @@ static int drm_hdmi_get_edid(struct device *dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_edid) -return hdmi_ops->get_edid (ctx->hdmi_ctx->ctx, connector, edid, - len); + return hdmi_ops->get_edid(ctx->hdmi_ctx->client, connector, + edid, len);return 0 ; }@@ -90,7 +90,7 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->check_timing) -return hdmi_ops->check_timing (ctx->hdmi_ctx->ctx, timing); +return hdmi_ops->check_timing (ctx->hdmi_ctx->client, timing);return 0 ; }@@ -102,7 +102,7 @@ static int drm_hdmi_power_on(struct device *dev, int mode) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->power_on) -return hdmi_ops->power_on (ctx->hdmi_ctx->ctx, mode); +return hdmi_ops->power_on (ctx->hdmi_ctx->client, mode);return 0 ; }@@ -124,7 +124,7 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->enable_vblank) -return mixer_ops->enable_vblank (ctx->mixer_ctx->ctx, +return mixer_ops->enable_vblank (ctx->mixer_ctx->client, manager->pipe);return 0 ;@@ -137,12 +137,12 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->disable_vblank) -return mixer_ops->disable_vblank (ctx->mixer_ctx->ctx); +return mixer_ops->disable_vblank (ctx->mixer_ctx->client); }static void drm_hdmi_mode_fixup (struct device *subdrv_dev,struct drm_connector *connector, -const struct drm_display_mode *mode, +struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct drm_hdmi_context *ctx =to_context (subdrv_dev);@@ -150,7 +150,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_fixup) - hdmi_ops->mode_fixup (ctx->hdmi_ctx->ctx, connector, mode, + hdmi_ops->mode_fixup (ctx->hdmi_ctx->client, connector, mode, adjusted_mode); }@@ -161,7 +161,7 @@ static void drm_hdmi_mode_set(struct device
*subdrv_dev, void *mode)DRM_DEBUG_KMS("%s\n", __FILE__); if (hdmi_ops && hdmi_ops->mode_set)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +2
-2- hdmi_ops->mode_set (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->mode_set (ctx->hdmi_ctx->client, mode); } static void drm_hdmi_get_max_resol(struct device *subdrv_dev,@@ -172,7 +172,7 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_max_resol) - hdmi_ops->get_max_resol (ctx->hdmi_ctx->ctx, width, height); + hdmi_ops->get_max_resol (ctx->hdmi_ctx->client, width, height); }static void
drm_hdmi_commit(struct device *subdrv_dev)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +8
-8@@ -182,7 +182,7 @@ static void drm_hdmi_commit(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static void drm_hdmi_dpms (struct device *subdrv_dev,int mode)@@ -192,10 +192,10 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode) DRM_DEBUG_KMS("%s\n", __FILE__);if (mixer_ops && mixer_ops->dpms) - mixer_ops->dpms (ctx->mixer_ctx->ctx, mode); + mixer_ops->dpms (ctx->mixer_ctx->client, mode);if (hdmi_ops && hdmi_ops->dpms) - hdmi_ops->dpms (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->dpms (ctx->hdmi_ctx->client, mode); }static void drm_hdmi_apply (struct device *subdrv_dev)@@ -209,11 +209,11 @@ static void drm_hdmi_apply(struct device *subdrv_dev)if (!ctx->enabled[i])continue ;if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, i); + mixer_ops->win_commit (ctx->mixer_ctx->client, i); }if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {@@ -235,7 +235,7 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->win_mode_set) - mixer_ops->win_mode_set (ctx->mixer_ctx->ctx, overlay); + mixer_ops->win_mode_set (ctx->mixer_ctx->client, overlay); }static void drm_mixer_commit (struct device *subdrv_dev,int zpos)@@ -251,7 +251,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, win); + mixer_ops->win_commit (ctx->mixer_ctx->client, win); ctx->enabled[win] = true; }@@ -269,7 +269,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_disable) - mixer_ops->win_disable (ctx->mixer_ctx->ctx, win); + mixer_ops->win_disable (ctx->mixer_ctx->client, win); ctx->enabled[win] = false; }drivers/gpu/drm/exynos/exynos_drm_hdmi.h +2
-2@@ -33,12 +33,12 @@* exynos hdmi common context structure. * * @drm_dev: pointer to drm_device. -* @ctx: pointer to the context of specific device driver. +* @client: pointer to the context of specific device driver. * this context should be hdmi_context or mixer_context. */ struct exynos_drm_hdmi_context {struct drm_device *drm_dev; -void *ctx; +void *client; };struct exynos_hdmi_ops {drivers/gpu/drm/exynos/exynos_hdmi.c +4
-3@@ -2108,7 +2108,7 @@ static struct exynos_hdmi_ops hdmi_ops = {static irqreturn_t hdmi_external_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;if (!hdata->get_hpd) goto out;@@ -2127,7 +2127,7 @@ out:static irqreturn_t hdmi_internal_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;u32 intc_flag; intc_flag =hdmi_reg_read (hdata,HDMI_INTC_FLAG );@@ -2295,7 +2295,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) mutex_init(&hdata->hdmi_mutex); - drm_hdmi_ctx->ctx = (void *)hdata; + drm_hdmi_ctx->client = (void *)hdata; hdata->parent_ctx = (void *)drm_hdmi_ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);@@ -2395,7 +2395,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct exynos_drm_hdmi_context *ctx =platform_get_drvdata (pdev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); @@ -2417,7 +2417,7 @@ static int __devexit hdmi_remove(struct
platform_device*pdev)
static inthdmi_suspend(struct device *dev){ struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);drivers/gpu/drm/exynos/exynos_hdmi.c +2
-2-struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;disable_irq (hdata->internal_irq);disable_irq (hdata->external_irq);@@ -2434,7 +2434,7 @@ static int hdmi_suspend(struct device *dev)static int hdmi_resume (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;enable_irq (hdata->external_irq);enable_irq (hdata->internal_irq);drivers/gpu/drm/exynos/exynos_mixer.c +1
-1@@ -864,7 +864,7 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)static irqreturn_t mixer_irq_handler (int irq,void *arg) {struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg; -struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;struct mixer_resources *res = &ctx->mixer_res;u32 val, base, shadow;@@ -909,7 +909,7 @@ out:
static int__devinitmixer_resources_init(structexynos_drm_hdmi_context
*ctx,
structplatform_device*pdev)
{drivers/gpu/drm/exynos/exynos_mixer.c +2
-2-struct mixer_context *mixer_ctx = ctx->ctx; +struct mixer_context *mixer_ctx = ctx->client;struct device *dev = &pdev->dev;struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;struct resource *res;@@ -1035,7 +1035,7 @@ static int __devinit mixer_probe(struct platform_device *pdev) mutex_init(&ctx->mixer_mutex); ctx->dev = &pdev->dev; - drm_hdmi_ctx->ctx = (void *)ctx; + drm_hdmi_ctx->client = (void *)ctx;platform_set_drvdata (pdev, drm_hdmi_ctx); @@ -1070,7 +1070,7 @@ static int mixer_remove(struct platform_device *pdev)static int
mixer_suspend(struct device *dev){
structexynos_drm_hdmi_context*drm_hdmi_ctx=get_mixer_context(dev);drivers/gpu/drm/exynos/exynos_mixer.c static int mixer_remove(struct platform_device *pdev) · line 1075
Quoted 3 lines
drivers/gpu/drm/exynos/exynos_mixer.c +1
-1-struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;mixer_poweroff (ctx);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 11/13] drm/exynos: changed context name of hdmi and mixer
Quoted 8 lines · InKi Dae
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 6 lines · Inki Dae
Quoted 2 lines
this patch changes ctx variable name in
exynos_drm_hdmi_contextstructure to client because the use of ctx variable makes it confused.I don't prefer "client" name. This is not client and server relationship.
Okay, give me your opinion. which one do you prefer?
Just "data".
Thanks.
Quoted 272 lines
Quoted 272 lines
Quoted 264 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 38 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++++---- drivers/gpu/drm/exynos/exynos_mixer.c | 8 +++--- 4 files changed, 31 insertions(+), 31 deletions(-)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +9
-9@@ -64,7 +64,7 @@ static bool drm_hdmi_is_connected(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->is_connected) -return hdmi_ops->is_connected (ctx->hdmi_ctx->ctx); +return hdmi_ops->is_connected (ctx->hdmi_ctx->client);return false; }@@ -77,8 +77,8 @@ static int drm_hdmi_get_edid(struct device *dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_edid) -return hdmi_ops->get_edid (ctx->hdmi_ctx->ctx, connector, edid, - len); + return hdmi_ops->get_edid(ctx->hdmi_ctx->client, connector, + edid, len);return 0 ; }@@ -90,7 +90,7 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->check_timing) -return hdmi_ops->check_timing (ctx->hdmi_ctx->ctx, timing); +return hdmi_ops->check_timing (ctx->hdmi_ctx->client, timing);return 0 ; }@@ -102,7 +102,7 @@ static int drm_hdmi_power_on(struct device *dev, int mode) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->power_on) -return hdmi_ops->power_on (ctx->hdmi_ctx->ctx, mode); +return hdmi_ops->power_on (ctx->hdmi_ctx->client, mode);return 0 ; }@@ -124,7 +124,7 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->enable_vblank) -return mixer_ops->enable_vblank (ctx->mixer_ctx->ctx, +return mixer_ops->enable_vblank (ctx->mixer_ctx->client, manager->pipe);return 0 ;@@ -137,12 +137,12 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->disable_vblank) -return mixer_ops->disable_vblank (ctx->mixer_ctx->ctx); +return mixer_ops->disable_vblank (ctx->mixer_ctx->client); }static void drm_hdmi_mode_fixup (struct device *subdrv_dev,struct drm_connector *connector, -const struct drm_display_mode *mode, +struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct drm_hdmi_context *ctx =to_context (subdrv_dev);@@ -150,7 +150,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_fixup) - hdmi_ops->mode_fixup (ctx->hdmi_ctx->ctx, connector, mode, + hdmi_ops->mode_fixup (ctx->hdmi_ctx->client, connector, mode, adjusted_mode); }@@ -161,7 +161,7 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) DRM_DEBUG_KMS("%s\n", __FILE__); if (hdmi_ops && hdmi_ops->mode_set)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +2
-2- hdmi_ops->mode_set (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->mode_set (ctx->hdmi_ctx->client, mode); } static void drm_hdmi_get_max_resol(struct device *subdrv_dev,@@ -172,7 +172,7 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_max_resol) - hdmi_ops->get_max_resol (ctx->hdmi_ctx->ctx, width, height); + hdmi_ops->get_max_resol (ctx->hdmi_ctx->client, width, height); }static void
drm_hdmi_commit(struct device *subdrv_dev)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +8
-8@@ -182,7 +182,7 @@ static void drm_hdmi_commit(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static void drm_hdmi_dpms (struct device *subdrv_dev,int mode)@@ -192,10 +192,10 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode) DRM_DEBUG_KMS("%s\n", __FILE__);if (mixer_ops && mixer_ops->dpms) - mixer_ops->dpms (ctx->mixer_ctx->ctx, mode); + mixer_ops->dpms (ctx->mixer_ctx->client, mode);if (hdmi_ops && hdmi_ops->dpms) - hdmi_ops->dpms (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->dpms (ctx->hdmi_ctx->client, mode); }static void drm_hdmi_apply (struct device *subdrv_dev)@@ -209,11 +209,11 @@ static void drm_hdmi_apply(struct device *subdrv_dev)if (!ctx->enabled[i])continue ;if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, i); + mixer_ops->win_commit (ctx->mixer_ctx->client, i); }if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {@@ -235,7 +235,7 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->win_mode_set) - mixer_ops->win_mode_set (ctx->mixer_ctx->ctx, overlay); + mixer_ops->win_mode_set (ctx->mixer_ctx->client, overlay); }static void drm_mixer_commit (struct device *subdrv_dev,int zpos)@@ -251,7 +251,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, win); + mixer_ops->win_commit (ctx->mixer_ctx->client, win); ctx->enabled[win] = true; }@@ -269,7 +269,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_disable) - mixer_ops->win_disable (ctx->mixer_ctx->ctx, win); + mixer_ops->win_disable (ctx->mixer_ctx->client, win); ctx->enabled[win] = false; }drivers/gpu/drm/exynos/exynos_drm_hdmi.h +2
-2@@ -33,12 +33,12 @@* exynos hdmi common context structure. * * @drm_dev: pointer to drm_device. -* @ctx: pointer to the context of specific device driver. +* @client: pointer to the context of specific device driver. * this context should be hdmi_context or mixer_context. */ struct exynos_drm_hdmi_context {struct drm_device *drm_dev; -void *ctx; +void *client; };struct exynos_hdmi_ops {drivers/gpu/drm/exynos/exynos_hdmi.c +4
-3@@ -2108,7 +2108,7 @@ static struct exynos_hdmi_ops hdmi_ops = {static irqreturn_t hdmi_external_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;if (!hdata->get_hpd) goto out;@@ -2127,7 +2127,7 @@ out:static irqreturn_t hdmi_internal_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;u32 intc_flag; intc_flag =hdmi_reg_read (hdata,HDMI_INTC_FLAG );@@ -2295,7 +2295,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) mutex_init(&hdata->hdmi_mutex); - drm_hdmi_ctx->ctx = (void *)hdata; + drm_hdmi_ctx->client = (void *)hdata; hdata->parent_ctx = (void *)drm_hdmi_ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);@@ -2395,7 +2395,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct exynos_drm_hdmi_context *ctx =platform_get_drvdata (pdev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__); @@ -2417,7 +2417,7 @@ static int __devexit hdmi_remove(struct
platform_device*pdev)
static inthdmi_suspend(struct device *dev){ struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);drivers/gpu/drm/exynos/exynos_hdmi.c +2
-2-struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;disable_irq (hdata->internal_irq);disable_irq (hdata->external_irq);@@ -2434,7 +2434,7 @@ static int hdmi_suspend(struct device *dev)static int hdmi_resume (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;enable_irq (hdata->external_irq);enable_irq (hdata->internal_irq);drivers/gpu/drm/exynos/exynos_mixer.c +1
-1@@ -864,7 +864,7 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)static irqreturn_t mixer_irq_handler (int irq,void *arg) {struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg; -struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;struct mixer_resources *res = &ctx->mixer_res;u32 val, base, shadow;@@ -909,7 +909,7 @@ out:
static int__devinitmixer_resources_init(structexynos_drm_hdmi_context
*ctx,
structplatform_device*pdev)
{drivers/gpu/drm/exynos/exynos_mixer.c +2
-2-struct mixer_context *mixer_ctx = ctx->ctx; +struct mixer_context *mixer_ctx = ctx->client;struct device *dev = &pdev->dev;struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;struct resource *res;@@ -1035,7 +1035,7 @@ static int __devinit mixer_probe(struct platform_device *pdev) mutex_init(&ctx->mixer_mutex); ctx->dev = &pdev->dev; - drm_hdmi_ctx->ctx = (void *)ctx; + drm_hdmi_ctx->client = (void *)ctx;platform_set_drvdata (pdev, drm_hdmi_ctx); @@ -1070,7 +1070,7 @@ static int mixer_remove(struct platform_device *pdev)static int
mixer_suspend(struct device *dev){
structexynos_drm_hdmi_context*drm_hdmi_ctx=get_mixer_context(dev);drivers/gpu/drm/exynos/exynos_mixer.c static int mixer_remove(struct platform_device *pdev) · line 1075
Quoted 3 lines
drivers/gpu/drm/exynos/exynos_mixer.c +1
-1-struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;mixer_poweroff (ctx);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
InKi Dae
maintainerRe: [PATCH 11/13] drm/exynos: changed context name of hdmi and mixer
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 10 lines · InKi Dae
Quoted 9 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 7 lines · Inki Dae
Quoted 3 lines
this patch changes ctx variable name in
exynos_drm_hdmi_contextstructure to client because the use of ctx variable makes it confused.
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
I don't prefer "client" name. This is not client and server relationship.
Okay, give me your opinion. which one do you prefer?
Just "data".
It's not clear. "data" is so comprehensive just use "child_ctx". we already use "parent_ctx" as the context of exynos_drm_hdmi module.
Quoted 290 lines
Thanks.
Quoted 273 lines
Quoted 273 lines
Quoted 273 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 38 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++++---- drivers/gpu/drm/exynos/exynos_mixer.c | 8 +++--- 4 files changed, 31 insertions(+), 31 deletions(-)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +4
-4@@ -64,7 +64,7 @@ static bool drm_hdmi_is_connected(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->is_connected) -return hdmi_ops->is_connected (ctx->hdmi_ctx->ctx); +return hdmi_ops->is_connected (ctx->hdmi_ctx->client);return false; }@@ -77,8 +77,8 @@ static int drm_hdmi_get_edid(struct device *dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_edid) -return hdmi_ops->get_edid (ctx->hdmi_ctx->ctx, connector, edid, - len); + return hdmi_ops->get_edid(ctx->hdmi_ctx->client, connector, + edid, len);return 0 ; }@@ -90,7 +90,7 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->check_timing) -return hdmi_ops->check_timing (ctx->hdmi_ctx->ctx, timing); +return hdmi_ops->check_timing (ctx->hdmi_ctx->client, timing);return 0 ;}drivers/gpu/drm/exynos/exynos_drm_hdmi.c +5
-5@@ -102,7 +102,7 @@ static int drm_hdmi_power_on(struct device *dev, int mode) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->power_on) -return hdmi_ops->power_on (ctx->hdmi_ctx->ctx, mode); +return hdmi_ops->power_on (ctx->hdmi_ctx->client, mode);return 0 ; }@@ -124,7 +124,7 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->enable_vblank) -return mixer_ops->enable_vblank (ctx->mixer_ctx->ctx, +return mixer_ops->enable_vblank (ctx->mixer_ctx->client, manager->pipe);return 0 ;@@ -137,12 +137,12 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->disable_vblank) -return mixer_ops->disable_vblank (ctx->mixer_ctx->ctx); +return mixer_ops->disable_vblank (ctx->mixer_ctx->client); }static void drm_hdmi_mode_fixup (struct device *subdrv_dev,struct drm_connector *connector, -const struct drm_display_mode *mode, +struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct drm_hdmi_context *ctx =to_context (subdrv_dev);@@ -150,7 +150,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_fixup) - hdmi_ops->mode_fixup (ctx->hdmi_ctx->ctx, connector, mode, + hdmi_ops->mode_fixup (ctx->hdmi_ctx->client, connector, mode, adjusted_mode);} @@ -161,7 +161,7 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) DRM_DEBUG_KMS("%s\n", __FILE__); if (hdmi_ops && hdmi_ops->mode_set)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +2
-2- hdmi_ops->mode_set (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->mode_set (ctx->hdmi_ctx->client, mode); } static void drm_hdmi_get_max_resol(struct device *subdrv_dev,@@ -172,7 +172,7 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_max_resol) - hdmi_ops->get_max_resol (ctx->hdmi_ctx->ctx, width, height); + hdmi_ops->get_max_resol (ctx->hdmi_ctx->client, width, height); }static void
drm_hdmi_commit(struct device *subdrv_dev)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +8
-8@@ -182,7 +182,7 @@ static void drm_hdmi_commit(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static void drm_hdmi_dpms (struct device *subdrv_dev,int mode)@@ -192,10 +192,10 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->dpms) - mixer_ops->dpms (ctx->mixer_ctx->ctx, mode); + mixer_ops->dpms (ctx->mixer_ctx->client, mode);if (hdmi_ops && hdmi_ops->dpms) - hdmi_ops->dpms (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->dpms (ctx->hdmi_ctx->client, mode); }static void drm_hdmi_apply (struct device *subdrv_dev)@@ -209,11 +209,11 @@ static void drm_hdmi_apply(struct device *subdrv_dev)if (!ctx->enabled[i])continue ;if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, i); + mixer_ops->win_commit (ctx->mixer_ctx->client, i); }if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {@@ -235,7 +235,7 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->win_mode_set) - mixer_ops->win_mode_set (ctx->mixer_ctx->ctx, overlay); + mixer_ops->win_mode_set (ctx->mixer_ctx->client, overlay); }static void drm_mixer_commit (struct device *subdrv_dev,int zpos)@@ -251,7 +251,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, win); + mixer_ops->win_commit (ctx->mixer_ctx->client, win); ctx->enabled[win] = true; }@@ -269,7 +269,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_disable) - mixer_ops->win_disable (ctx->mixer_ctx->ctx, win); + mixer_ops->win_disable (ctx->mixer_ctx->client, win); ctx->enabled[win] = false; }drivers/gpu/drm/exynos/exynos_drm_hdmi.h +2
-2@@ -33,12 +33,12 @@* exynos hdmi common context structure. * * @drm_dev: pointer to drm_device. -* @ctx: pointer to the context of specific device driver. +* @client: pointer to the context of specific device driver. * this context should be hdmi_context or mixer_context. */ struct exynos_drm_hdmi_context {struct drm_device *drm_dev; -void *ctx; +void *client; };struct exynos_hdmi_ops {drivers/gpu/drm/exynos/exynos_hdmi.c +4
-3@@ -2108,7 +2108,7 @@ static struct exynos_hdmi_ops hdmi_ops = {static irqreturn_t hdmi_external_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;if (!hdata->get_hpd) goto out;@@ -2127,7 +2127,7 @@ out:static irqreturn_t hdmi_internal_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;u32 intc_flag; intc_flag =hdmi_reg_read (hdata,HDMI_INTC_FLAG );@@ -2295,7 +2295,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) mutex_init(&hdata->hdmi_mutex); - drm_hdmi_ctx->ctx = (void *)hdata; + drm_hdmi_ctx->client = (void *)hdata; hdata->parent_ctx = (void *)drm_hdmi_ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);@@ -2395,7 +2395,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct exynos_drm_hdmi_context *ctx =platform_get_drvdata (pdev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);@@ -2417,7 +2417,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) static int hdmi_suspend(struct device *dev) { struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);drivers/gpu/drm/exynos/exynos_hdmi.c +2
-2-struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;disable_irq (hdata->internal_irq);disable_irq (hdata->external_irq);@@ -2434,7 +2434,7 @@ static int hdmi_suspend(struct device *dev)static int hdmi_resume (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;enable_irq (hdata->external_irq);enable_irq (hdata->internal_irq);drivers/gpu/drm/exynos/exynos_mixer.c +1
-1@@ -864,7 +864,7 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)static irqreturn_t mixer_irq_handler (int irq,void *arg) {struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg; -struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;struct mixer_resources *res = &ctx->mixer_res;u32 val, base, shadow;@@ -909,7 +909,7 @@ out:
static int__devinitmixer_resources_init(structexynos_drm_hdmi_context
*ctx,
structplatform_device*pdev)
{drivers/gpu/drm/exynos/exynos_mixer.c +2
-2-struct mixer_context *mixer_ctx = ctx->ctx; +struct mixer_context *mixer_ctx = ctx->client;struct device *dev = &pdev->dev;struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;struct resource *res;@@ -1035,7 +1035,7 @@ static int __devinit mixer_probe(struct platform_device *pdev) mutex_init(&ctx->mixer_mutex); ctx->dev = &pdev->dev; - drm_hdmi_ctx->ctx = (void *)ctx; + drm_hdmi_ctx->client = (void *)ctx;platform_set_drvdata (pdev, drm_hdmi_ctx); @@ -1070,7 +1070,7 @@ static int mixer_remove(struct platform_device *pdev)static int
mixer_suspend(struct device *dev){
structexynos_drm_hdmi_context*drm_hdmi_ctx=get_mixer_context(dev);
- structmixer_context*ctx =drm_hdmi_ctx->ctx;Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
+ struct mixer_context *ctx = drm_hdmi_ctx->client; mixer_poweroff(ctx);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 11/13] drm/exynos: changed context name of hdmi and mixer
Quoted 7 lines · InKi Dae
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 6 lines · InKi Dae
Quoted 5 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 4 lines · Inki Dae
Quoted 2 lines
this patch changes ctx variable name in
exynos_drm_hdmi_contextstructure to client because the use of ctx variable makes it confused.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
I don't prefer "client" name. This is not client and server relationship.
Okay, give me your opinion. which one do you prefer?
Just "data".
It's not clear. "data" is so comprehensive just use "
child_ctx". we already use "parent_ctx" as the context ofexynos_drm_hdmimodule.
Actually, i prefer "data" term than "ctx" term. Anyway i want to focus why this problem is occurred because i think that codes are some ugly. I think we first need to consider to solve this situation using code redesign, structure change and etc.
Thanks.
Quoted 289 lines
Quoted 289 lines
Thanks.
Quoted 272 lines
Quoted 272 lines
Quoted 272 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 38 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++++---- drivers/gpu/drm/exynos/exynos_mixer.c | 8 +++--- 4 files changed, 31 insertions(+), 31 deletions(-)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +4
-4@@ -64,7 +64,7 @@ static bool drm_hdmi_is_connected(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->is_connected) -return hdmi_ops->is_connected (ctx->hdmi_ctx->ctx); +return hdmi_ops->is_connected (ctx->hdmi_ctx->client);return false; }@@ -77,8 +77,8 @@ static int drm_hdmi_get_edid(struct device *dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_edid) -return hdmi_ops->get_edid (ctx->hdmi_ctx->ctx, connector, edid, - len); + return hdmi_ops->get_edid(ctx->hdmi_ctx->client, connector, + edid, len);return 0 ; }@@ -90,7 +90,7 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->check_timing) -return hdmi_ops->check_timing (ctx->hdmi_ctx->ctx, timing); +return hdmi_ops->check_timing (ctx->hdmi_ctx->client, timing);return 0 ;}drivers/gpu/drm/exynos/exynos_drm_hdmi.c +5
-5@@ -102,7 +102,7 @@ static int drm_hdmi_power_on(struct device *dev, int mode) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->power_on) -return hdmi_ops->power_on (ctx->hdmi_ctx->ctx, mode); +return hdmi_ops->power_on (ctx->hdmi_ctx->client, mode);return 0 ; }@@ -124,7 +124,7 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->enable_vblank) -return mixer_ops->enable_vblank (ctx->mixer_ctx->ctx, +return mixer_ops->enable_vblank (ctx->mixer_ctx->client, manager->pipe);return 0 ;@@ -137,12 +137,12 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->disable_vblank) -return mixer_ops->disable_vblank (ctx->mixer_ctx->ctx); +return mixer_ops->disable_vblank (ctx->mixer_ctx->client); }static void drm_hdmi_mode_fixup (struct device *subdrv_dev,struct drm_connector *connector, -const struct drm_display_mode *mode, +struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct drm_hdmi_context *ctx =to_context (subdrv_dev);@@ -150,7 +150,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_fixup) - hdmi_ops->mode_fixup (ctx->hdmi_ctx->ctx, connector, mode, + hdmi_ops->mode_fixup (ctx->hdmi_ctx->client, connector, mode, adjusted_mode);} @@ -161,7 +161,7 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) DRM_DEBUG_KMS("%s\n", __FILE__); if (hdmi_ops && hdmi_ops->mode_set)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +2
-2- hdmi_ops->mode_set (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->mode_set (ctx->hdmi_ctx->client, mode); } static void drm_hdmi_get_max_resol(struct device *subdrv_dev,@@ -172,7 +172,7 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_max_resol) - hdmi_ops->get_max_resol (ctx->hdmi_ctx->ctx, width, height); + hdmi_ops->get_max_resol (ctx->hdmi_ctx->client, width, height); }static void
drm_hdmi_commit(struct device *subdrv_dev)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +8
-8@@ -182,7 +182,7 @@ static void drm_hdmi_commit(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static void drm_hdmi_dpms (struct device *subdrv_dev,int mode)@@ -192,10 +192,10 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->dpms) - mixer_ops->dpms (ctx->mixer_ctx->ctx, mode); + mixer_ops->dpms (ctx->mixer_ctx->client, mode);if (hdmi_ops && hdmi_ops->dpms) - hdmi_ops->dpms (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->dpms (ctx->hdmi_ctx->client, mode); }static void drm_hdmi_apply (struct device *subdrv_dev)@@ -209,11 +209,11 @@ static void drm_hdmi_apply(struct device *subdrv_dev)if (!ctx->enabled[i])continue ;if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, i); + mixer_ops->win_commit (ctx->mixer_ctx->client, i); }if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {@@ -235,7 +235,7 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->win_mode_set) - mixer_ops->win_mode_set (ctx->mixer_ctx->ctx, overlay); + mixer_ops->win_mode_set (ctx->mixer_ctx->client, overlay); }static void drm_mixer_commit (struct device *subdrv_dev,int zpos)@@ -251,7 +251,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, win); + mixer_ops->win_commit (ctx->mixer_ctx->client, win); ctx->enabled[win] = true; }@@ -269,7 +269,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_disable) - mixer_ops->win_disable (ctx->mixer_ctx->ctx, win); + mixer_ops->win_disable (ctx->mixer_ctx->client, win); ctx->enabled[win] = false; }drivers/gpu/drm/exynos/exynos_drm_hdmi.h +2
-2@@ -33,12 +33,12 @@* exynos hdmi common context structure. * * @drm_dev: pointer to drm_device. -* @ctx: pointer to the context of specific device driver. +* @client: pointer to the context of specific device driver. * this context should be hdmi_context or mixer_context. */ struct exynos_drm_hdmi_context {struct drm_device *drm_dev; -void *ctx; +void *client; };struct exynos_hdmi_ops {drivers/gpu/drm/exynos/exynos_hdmi.c +4
-3@@ -2108,7 +2108,7 @@ static struct exynos_hdmi_ops hdmi_ops = {static irqreturn_t hdmi_external_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;if (!hdata->get_hpd) goto out;@@ -2127,7 +2127,7 @@ out:static irqreturn_t hdmi_internal_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;u32 intc_flag; intc_flag =hdmi_reg_read (hdata,HDMI_INTC_FLAG );@@ -2295,7 +2295,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) mutex_init(&hdata->hdmi_mutex); - drm_hdmi_ctx->ctx = (void *)hdata; + drm_hdmi_ctx->client = (void *)hdata; hdata->parent_ctx = (void *)drm_hdmi_ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);@@ -2395,7 +2395,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct exynos_drm_hdmi_context *ctx =platform_get_drvdata (pdev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);@@ -2417,7 +2417,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) static int hdmi_suspend(struct device *dev) { struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);drivers/gpu/drm/exynos/exynos_hdmi.c +2
-2-struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;disable_irq (hdata->internal_irq);disable_irq (hdata->external_irq);@@ -2434,7 +2434,7 @@ static int hdmi_suspend(struct device *dev)static int hdmi_resume (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;enable_irq (hdata->external_irq);enable_irq (hdata->internal_irq);drivers/gpu/drm/exynos/exynos_mixer.c +1
-1@@ -864,7 +864,7 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)static irqreturn_t mixer_irq_handler (int irq,void *arg) {struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg; -struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;struct mixer_resources *res = &ctx->mixer_res;u32 val, base, shadow;@@ -909,7 +909,7 @@ out:
static int__devinitmixer_resources_init(structexynos_drm_hdmi_context
*ctx,
structplatform_device*pdev)
{drivers/gpu/drm/exynos/exynos_mixer.c +2
-2-struct mixer_context *mixer_ctx = ctx->ctx; +struct mixer_context *mixer_ctx = ctx->client;struct device *dev = &pdev->dev;struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;struct resource *res;@@ -1035,7 +1035,7 @@ static int __devinit mixer_probe(struct platform_device *pdev) mutex_init(&ctx->mixer_mutex); ctx->dev = &pdev->dev; - drm_hdmi_ctx->ctx = (void *)ctx; + drm_hdmi_ctx->client = (void *)ctx;platform_set_drvdata (pdev, drm_hdmi_ctx); @@ -1070,7 +1070,7 @@ static int mixer_remove(struct platform_device *pdev)static int
mixer_suspend(struct device *dev){
structexynos_drm_hdmi_context*drm_hdmi_ctx=get_mixer_context(dev);Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/exynos/exynos_mixer.c static int mixer_remove(struct platform_device *pdev) · line 1075
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_mixer.c +1
-1-struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;mixer_poweroff (ctx);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
InKi Dae
maintainerRe: [PATCH 11/13] drm/exynos: changed context name of hdmi and mixer
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 22 lines · InKi Dae
Quoted 21 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 19 lines · InKi Dae
Quoted 5 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 3 lines · Inki Dae
Quoted 1 line
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
this patch changes ctx variable name in
exynos_drm_hdmi_contextstructure to client because the use of ctx variable makes it confused.I don't prefer "client" name. This is not client and server relationship.
Okay, give me your opinion. which one do you prefer?
Just "data".
Quoted 9 lines
Quoted 2 lines
It's not clear. "data" is so comprehensive just use "
child_ctx". we already use "parent_ctx" as the context ofexynos_drm_hdmimodule.Actually, i prefer "data" term than "ctx" term. Anyway i want to focus why this problem is occurred because i think that codes are some ugly. I think we first need to consider to solve this situation using code redesign, structure change and etc.
calm down and focus on the use of term. this is so minor and this is not related to design issue.
Quoted 309 lines
Thanks.
Quoted 296 lines
Quoted 296 lines
Thanks.
Quoted 290 lines
Quoted 290 lines
Quoted 283 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 38 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++++---- drivers/gpu/drm/exynos/exynos_mixer.c | 8 +++--- 4 files changed, 31 insertions(+), 31 deletions(-)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +3
-3@@ -64,7 +64,7 @@ static bool drm_hdmi_is_connected(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->is_connected) -return hdmi_ops->is_connected (ctx->hdmi_ctx->ctx); +return hdmi_ops->is_connected (ctx->hdmi_ctx->client);return false; }@@ -77,8 +77,8 @@ static int drm_hdmi_get_edid(struct device *dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_edid) -return hdmi_ops->get_edid (ctx->hdmi_ctx->ctx, connector, edid, - len); + return hdmi_ops->get_edid(ctx->hdmi_ctx->client, connector, + edid, len);return 0 ;}drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1@@ -90,7 +90,7 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->check_timing) -return hdmi_ops->check_timing (ctx->hdmi_ctx->ctx, timing); +return hdmi_ops->check_timing (ctx->hdmi_ctx->client, timing);return 0 ;}drivers/gpu/drm/exynos/exynos_drm_hdmi.c +0
-0@@ -102,7 +102,7 @@ static int drm_hdmi_power_on(struct device *dev,int
mode)DRM_DEBUG_KMS("%s\n", __FILE__); if (hdmi_ops && hdmi_ops->power_on)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1-return hdmi_ops->power_on (ctx->hdmi_ctx->ctx, mode); + return hdmi_ops->power_on(ctx->hdmi_ctx->client,mode); return 0; }drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1@@ -124,7 +124,7 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->enable_vblank) -return mixer_ops->enable_vblank (ctx->mixer_ctx->ctx, +return mixer_ops->enable_vblank (ctx->mixer_ctx->client, manager->pipe);return 0 ;@@ -137,12 +137,12 @@ static void drm_hdmi_disable_vblank(structdevice
*subdrv_dev)DRM_DEBUG_KMS("%s\n", __FILE__); if (mixer_ops && mixer_ops->disable_vblank)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1-return mixer_ops->disable_vblank (ctx->mixer_ctx->ctx); +return
mixer_ops->disable_vblank(ctx->mixer_ctx->client);
}
static void drm_hdmi_mode_fixup(struct device*subdrv_dev,
structdrm_connector*connector,drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1-const struct drm_display_mode *mode, +struct drm_display_mode *mode, struct drm_display_mode
*adjusted_mode){ struct drm_hdmi_context *ctx = to_context(subdrv_dev);drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1@@ -150,7 +150,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_fixup) - hdmi_ops->mode_fixup (ctx->hdmi_ctx->ctx, connector, mode, + hdmi_ops->mode_fixup (ctx->hdmi_ctx->client, connector, mode, adjusted_mode);} @@ -161,7 +161,7 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) DRM_DEBUG_KMS("%s\n", __FILE__); if (hdmi_ops && hdmi_ops->mode_set)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +2
-2- hdmi_ops->mode_set (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->mode_set (ctx->hdmi_ctx->client, mode); } static void drm_hdmi_get_max_resol(struct device *subdrv_dev,@@ -172,7 +172,7 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_max_resol) - hdmi_ops->get_max_resol (ctx->hdmi_ctx->ctx, width, height); + hdmi_ops->get_max_resol (ctx->hdmi_ctx->client, width, height); }static void
drm_hdmi_commit(struct device *subdrv_dev)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +6
-6@@ -182,7 +182,7 @@ static void drm_hdmi_commit(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static void drm_hdmi_dpms (struct device *subdrv_dev,int mode)@@ -192,10 +192,10 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->dpms) - mixer_ops->dpms (ctx->mixer_ctx->ctx, mode); + mixer_ops->dpms (ctx->mixer_ctx->client, mode);if (hdmi_ops && hdmi_ops->dpms) - hdmi_ops->dpms (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->dpms (ctx->hdmi_ctx->client, mode); }static void drm_hdmi_apply (struct device *subdrv_dev)@@ -209,11 +209,11 @@ static void drm_hdmi_apply(struct device *subdrv_dev)if (!ctx->enabled[i])continue ;if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, i); + mixer_ops->win_commit (ctx->mixer_ctx->client, i); }if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {@@ -235,7 +235,7 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->win_mode_set) - mixer_ops->win_mode_set (ctx->mixer_ctx->ctx, overlay); + mixer_ops->win_mode_set (ctx->mixer_ctx->client, overlay); } static void drm_mixer_commit(struct device *subdrv_dev, intzpos)
drivers/gpu/drm/exynos/exynos_drm_hdmi.c +2
-2@@ -251,7 +251,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, win); + mixer_ops->win_commit (ctx->mixer_ctx->client, win); ctx->enabled[win] = true; }@@ -269,7 +269,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_disable) - mixer_ops->win_disable (ctx->mixer_ctx->ctx, win); + mixer_ops->win_disable (ctx->mixer_ctx->client, win); ctx->enabled[win] = false; }drivers/gpu/drm/exynos/exynos_drm_hdmi.h +2
-2@@ -33,12 +33,12 @@* exynos hdmi common context structure. * * @drm_dev: pointer to drm_device. -* @ctx: pointer to the context of specific device driver. +* @client: pointer to the context of specific device driver. * this context should be hdmi_context or mixer_context. */ struct exynos_drm_hdmi_context {struct drm_device *drm_dev; -void *ctx; +void *client; };struct exynos_hdmi_ops {drivers/gpu/drm/exynos/exynos_hdmi.c +4
-3@@ -2108,7 +2108,7 @@ static struct exynos_hdmi_ops hdmi_ops = {static irqreturn_t hdmi_external_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;if (!hdata->get_hpd) goto out;@@ -2127,7 +2127,7 @@ out:static irqreturn_t hdmi_internal_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;u32 intc_flag; intc_flag =hdmi_reg_read (hdata,HDMI_INTC_FLAG );@@ -2295,7 +2295,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) mutex_init(&hdata->hdmi_mutex); - drm_hdmi_ctx->ctx = (void *)hdata; + drm_hdmi_ctx->client = (void *)hdata; hdata->parent_ctx = (void *)drm_hdmi_ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);@@ -2395,7 +2395,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct exynos_drm_hdmi_context *ctx =platform_get_drvdata (pdev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);@@ -2417,7 +2417,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) static int hdmi_suspend(struct device *dev) { struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);drivers/gpu/drm/exynos/exynos_hdmi.c +2
-2-struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;disable_irq (hdata->internal_irq);disable_irq (hdata->external_irq);@@ -2434,7 +2434,7 @@ static int hdmi_suspend(struct device *dev)static int hdmi_resume (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;enable_irq (hdata->external_irq);enable_irq (hdata->internal_irq);drivers/gpu/drm/exynos/exynos_mixer.c +0
-0@@ -864,7 +864,7 @@ static void mixer_finish_pageflip(struct
drm_device*drm_dev, int crtc)static irqreturn_t mixer_irq_handler(int irq, void *arg) { struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg;drivers/gpu/drm/exynos/exynos_mixer.c +1
-1-struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;struct mixer_resources *res = &ctx->mixer_res;u32 val, base, shadow; @@ -909,7 +909,7 @@ out: static int __devinit mixer_resources_init(struct
exynos_drm_hdmi_context
*ctx,
structplatform_device*pdev)
{drivers/gpu/drm/exynos/exynos_mixer.c +2
-2-struct mixer_context *mixer_ctx = ctx->ctx; +struct mixer_context *mixer_ctx = ctx->client;struct device *dev = &pdev->dev;struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;struct resource *res;@@ -1035,7 +1035,7 @@ static int __devinit mixer_probe(struct platform_device *pdev) mutex_init(&ctx->mixer_mutex); ctx->dev = &pdev->dev; - drm_hdmi_ctx->ctx = (void *)ctx; + drm_hdmi_ctx->client = (void *)ctx;platform_set_drvdata (pdev, drm_hdmi_ctx); @@ -1070,7 +1070,7 @@ static int mixer_remove(struct
platform_device
*pdev)
static intmixer_suspend(struct device *dev){
structexynos_drm_hdmi_context*drm_hdmi_ctx=get_mixer_context(dev);drivers/gpu/drm/exynos/exynos_mixer.c static int mixer_remove(struct platform_device *pdev) · line 1075
Quoted 3 lines
drivers/gpu/drm/exynos/exynos_mixer.c +1
-1-struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;mixer_poweroff (ctx);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-develQuoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
InKi Dae
maintainerRe: [PATCH 11/13] drm/exynos: changed context name of hdmi and mixer
2012/8/20 InKi Dae <[email protected]>:
Quoted 27 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 26 lines · InKi Dae
Quoted 23 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 11 lines · InKi Dae
Quoted 9 lines
2012/8/20 Joonyoung Shim <[email protected]>:
Quoted 7 lines · Inki Dae
Quoted 3 lines
this patch changes ctx variable name in
exynos_drm_hdmi_contextstructure to client because the use of ctx variable makes it confused.Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
I don't prefer "client" name. This is not client and server relationship.
Okay, give me your opinion. which one do you prefer?
Just "data".
It's not clear. "data" is so comprehensive just use "
child_ctx". we already use "parent_ctx" as the context ofexynos_drm_hdmimodule.
Quoted 9 lines
Quoted 5 lines
Actually, i prefer "data" term than "ctx" term. Anyway i want to focus why this problem is occurred because i think that codes are some ugly. I think we first need to consider to solve this situation using code redesign, structure change and etc.
calm down and focus on the use of term. this is so minor and this is not related to design issue.
and it's not important whether you prefer this term or not. if the use of "data" term is logical enough then we will use it otherwise "child_ctx" so give me your comment why you don't prefer "child_ctx" term. actually, now hdmi codes use "hdata" term as context's instance but other use "ctx" term. as I mentioned before, I gave you my opinion that "data" term is so comprehensive so I DON'T PREFER "data" term.
Quoted 309 lines
Quoted 309 lines
Thanks.
Quoted 296 lines
Quoted 296 lines
Thanks.
Quoted 290 lines
Quoted 290 lines
Quoted 283 lines
Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 38 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++++---- drivers/gpu/drm/exynos/exynos_mixer.c | 8 +++--- 4 files changed, 31 insertions(+), 31 deletions(-)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +3
-3@@ -64,7 +64,7 @@ static bool drm_hdmi_is_connected(struct device *dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->is_connected) -return hdmi_ops->is_connected (ctx->hdmi_ctx->ctx); +return hdmi_ops->is_connected (ctx->hdmi_ctx->client);return false; }@@ -77,8 +77,8 @@ static int drm_hdmi_get_edid(struct device *dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_edid) -return hdmi_ops->get_edid (ctx->hdmi_ctx->ctx, connector, edid, - len); + return hdmi_ops->get_edid(ctx->hdmi_ctx->client, connector, + edid, len);return 0 ;}drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1@@ -90,7 +90,7 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing) DRM_DEBUG_KMS("%s\n", __FILE__);if (hdmi_ops && hdmi_ops->check_timing) -return hdmi_ops->check_timing (ctx->hdmi_ctx->ctx, timing); +return hdmi_ops->check_timing (ctx->hdmi_ctx->client, timing);return 0 ;}drivers/gpu/drm/exynos/exynos_drm_hdmi.c +0
-0@@ -102,7 +102,7 @@ static int drm_hdmi_power_on(struct device *dev,int
mode)DRM_DEBUG_KMS("%s\n", __FILE__); if (hdmi_ops && hdmi_ops->power_on)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1-return hdmi_ops->power_on (ctx->hdmi_ctx->ctx, mode); + return hdmi_ops->power_on(ctx->hdmi_ctx->client,mode); return 0; }drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1@@ -124,7 +124,7 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->enable_vblank) -return mixer_ops->enable_vblank (ctx->mixer_ctx->ctx, +return mixer_ops->enable_vblank (ctx->mixer_ctx->client, manager->pipe);return 0 ;@@ -137,12 +137,12 @@ static void drm_hdmi_disable_vblank(structdevice
*subdrv_dev)DRM_DEBUG_KMS("%s\n", __FILE__); if (mixer_ops && mixer_ops->disable_vblank)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1-return mixer_ops->disable_vblank (ctx->mixer_ctx->ctx); +return
mixer_ops->disable_vblank(ctx->mixer_ctx->client);
}
static void drm_hdmi_mode_fixup(struct device*subdrv_dev,
structdrm_connector*connector,drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1-const struct drm_display_mode *mode, +struct drm_display_mode *mode, struct drm_display_mode
*adjusted_mode){ struct drm_hdmi_context *ctx = to_context(subdrv_dev);drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1
-1@@ -150,7 +150,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->mode_fixup) - hdmi_ops->mode_fixup (ctx->hdmi_ctx->ctx, connector, mode, + hdmi_ops->mode_fixup (ctx->hdmi_ctx->client, connector, mode, adjusted_mode);} @@ -161,7 +161,7 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) DRM_DEBUG_KMS("%s\n", __FILE__); if (hdmi_ops && hdmi_ops->mode_set)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +2
-2- hdmi_ops->mode_set (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->mode_set (ctx->hdmi_ctx->client, mode); } static void drm_hdmi_get_max_resol(struct device *subdrv_dev,@@ -172,7 +172,7 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->get_max_resol) - hdmi_ops->get_max_resol (ctx->hdmi_ctx->ctx, width, height); + hdmi_ops->get_max_resol (ctx->hdmi_ctx->client, width, height); }static void
drm_hdmi_commit(struct device *subdrv_dev)drivers/gpu/drm/exynos/exynos_drm_hdmi.c +6
-6@@ -182,7 +182,7 @@ static void drm_hdmi_commit(struct device *subdrv_dev)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static void drm_hdmi_dpms (struct device *subdrv_dev,int mode)@@ -192,10 +192,10 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->dpms) - mixer_ops->dpms (ctx->mixer_ctx->ctx, mode); + mixer_ops->dpms (ctx->mixer_ctx->client, mode);if (hdmi_ops && hdmi_ops->dpms) - hdmi_ops->dpms (ctx->hdmi_ctx->ctx, mode); + hdmi_ops->dpms (ctx->hdmi_ctx->client, mode); }static void drm_hdmi_apply (struct device *subdrv_dev)@@ -209,11 +209,11 @@ static void drm_hdmi_apply(struct device *subdrv_dev)if (!ctx->enabled[i])continue ;if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, i); + mixer_ops->win_commit (ctx->mixer_ctx->client, i); }if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit (ctx->hdmi_ctx->ctx); + hdmi_ops->commit (ctx->hdmi_ctx->client); }static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {@@ -235,7 +235,7 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,DRM_DEBUG_KMS ("%s\n" , __FILE__);if (mixer_ops && mixer_ops->win_mode_set) - mixer_ops->win_mode_set (ctx->mixer_ctx->ctx, overlay); + mixer_ops->win_mode_set (ctx->mixer_ctx->client, overlay); } static void drm_mixer_commit(struct device *subdrv_dev, intzpos)
drivers/gpu/drm/exynos/exynos_drm_hdmi.c +2
-2@@ -251,7 +251,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit (ctx->mixer_ctx->ctx, win); + mixer_ops->win_commit (ctx->mixer_ctx->client, win); ctx->enabled[win] = true; }@@ -269,7 +269,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) }if (mixer_ops && mixer_ops->win_disable) - mixer_ops->win_disable (ctx->mixer_ctx->ctx, win); + mixer_ops->win_disable (ctx->mixer_ctx->client, win); ctx->enabled[win] = false; }drivers/gpu/drm/exynos/exynos_drm_hdmi.h +2
-2@@ -33,12 +33,12 @@* exynos hdmi common context structure. * * @drm_dev: pointer to drm_device. -* @ctx: pointer to the context of specific device driver. +* @client: pointer to the context of specific device driver. * this context should be hdmi_context or mixer_context. */ struct exynos_drm_hdmi_context {struct drm_device *drm_dev; -void *ctx; +void *client; };struct exynos_hdmi_ops {drivers/gpu/drm/exynos/exynos_hdmi.c +4
-3@@ -2108,7 +2108,7 @@ static struct exynos_hdmi_ops hdmi_ops = {static irqreturn_t hdmi_external_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;if (!hdata->get_hpd) goto out;@@ -2127,7 +2127,7 @@ out:static irqreturn_t hdmi_internal_irq_thread (int irq,void *arg) {struct exynos_drm_hdmi_context *ctx = arg; -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;u32 intc_flag; intc_flag =hdmi_reg_read (hdata,HDMI_INTC_FLAG );@@ -2295,7 +2295,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) mutex_init(&hdata->hdmi_mutex); - drm_hdmi_ctx->ctx = (void *)hdata; + drm_hdmi_ctx->client = (void *)hdata; hdata->parent_ctx = (void *)drm_hdmi_ctx;platform_set_drvdata (pdev, drm_hdmi_ctx);@@ -2395,7 +2395,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct exynos_drm_hdmi_context *ctx =platform_get_drvdata (pdev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;DRM_DEBUG_KMS ("[%d] %s\n" , __LINE__, __func__);@@ -2417,7 +2417,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) static int hdmi_suspend(struct device *dev) { struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);drivers/gpu/drm/exynos/exynos_hdmi.c +2
-2-struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;disable_irq (hdata->internal_irq);disable_irq (hdata->external_irq);@@ -2434,7 +2434,7 @@ static int hdmi_suspend(struct device *dev)static int hdmi_resume (struct device *dev) {struct exynos_drm_hdmi_context *ctx =get_hdmi_context (dev); -struct hdmi_context *hdata = ctx->ctx; +struct hdmi_context *hdata = ctx->client;enable_irq (hdata->external_irq);enable_irq (hdata->internal_irq);drivers/gpu/drm/exynos/exynos_mixer.c +0
-0@@ -864,7 +864,7 @@ static void mixer_finish_pageflip(struct
drm_device*drm_dev, int crtc)static irqreturn_t mixer_irq_handler(int irq, void *arg) { struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg;drivers/gpu/drm/exynos/exynos_mixer.c +1
-1-struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;struct mixer_resources *res = &ctx->mixer_res;u32 val, base, shadow; @@ -909,7 +909,7 @@ out: static int __devinit mixer_resources_init(struct
exynos_drm_hdmi_context
*ctx,
structplatform_device*pdev)
{drivers/gpu/drm/exynos/exynos_mixer.c +2
-2-struct mixer_context *mixer_ctx = ctx->ctx; +struct mixer_context *mixer_ctx = ctx->client;struct device *dev = &pdev->dev;struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;struct resource *res;@@ -1035,7 +1035,7 @@ static int __devinit mixer_probe(struct platform_device *pdev) mutex_init(&ctx->mixer_mutex); ctx->dev = &pdev->dev; - drm_hdmi_ctx->ctx = (void *)ctx; + drm_hdmi_ctx->client = (void *)ctx;platform_set_drvdata (pdev, drm_hdmi_ctx); @@ -1070,7 +1070,7 @@ static int mixer_remove(struct
platform_device
*pdev)
static intmixer_suspend(struct device *dev){
structexynos_drm_hdmi_context*drm_hdmi_ctx=get_mixer_context(dev);drivers/gpu/drm/exynos/exynos_mixer.c
Quoted 3 lines
drivers/gpu/drm/exynos/exynos_mixer.c +1
-1-struct mixer_context *ctx = drm_hdmi_ctx->ctx; +struct mixer_context *ctx = drm_hdmi_ctx->client;mixer_poweroff (ctx);_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-develQuoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerPATCH 12/13 drm/exynos: fixed build warning
In reply to Inki Daethe argument of drm_hdmi_mode_fixup function, struct drm_display_mode should be declared as const.
--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_hdmi.c +1 -1
@@ -142,7 +142,7 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)static void drm_hdmi_mode_fixup (struct device *subdrv_dev,struct drm_connector *connector, -struct drm_display_mode *mode, +const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct drm_hdmi_context *ctx =to_context (subdrv_dev);
Signature · 1 line
1.7.4.1
Inki Dae
maintainerPATCH 13/13 drm/exynos: make sure that hardware overlay for hdmi is disabled
In reply to Inki Daethe values set to registers will be updated into real registers at vsync so dma operation could be malfunctioned when accessed to memory after gem buffer was released. this patch makes sure that hw overlay is disabled before the gem buffer is released.
--- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 11 +++++++++++ drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 1 + drivers/gpu/drm/exynos/exynos_mixer.c | 13 +++++++++++++ 3 files changed, 25 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_hdmi.c +11 -0
@@ -274,10 +274,21 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) ctx->enabled[win] = false; } +static void drm_mixer_wait_for_vblank (struct device *subdrv_dev) +{ +struct drm_hdmi_context *ctx =to_context (subdrv_dev); + +DRM_DEBUG_KMS ("%s\n" , __FILE__); + +if (mixer_ops && mixer_ops->wait_for_vblank) + mixer_ops->wait_for_vblank (ctx->mixer_ctx->client); +} +static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = { .mode_set = drm_mixer_mode_set, .commit = drm_mixer_commit, .disable = drm_mixer_disable, + .wait_for_vblank = drm_mixer_wait_for_vblank, };static struct exynos_drm_manager hdmi_manager = {
drivers/gpu/drm/exynos/exynos_drm_hdmi.h +1 -0
@@ -67,6 +67,7 @@ struct exynos_mixer_ops {void (*dpms)(void *ctx,int mode);/* overlay */ +void (*wait_for_vblank)(void *ctx);void (*win_mode_set)(void *ctx,struct exynos_drm_overlay *overlay);void (*win_commit)(void *ctx,int zpos);void (*win_disable)(void *ctx,int zpos);
drivers/gpu/drm/exynos/exynos_mixer.c +13 -0
@@ -726,6 +726,18 @@ static void mixer_dpms(void *ctx, int mode) } } +static void mixer_wait_for_vblank (void *ctx) +{ +struct mixer_context *mixer_ctx = ctx; +struct mixer_resources *res = &mixer_ctx->mixer_res; +int ret; + + ret =wait_for ((mixer_reg_read (res,MXR_INT_STATUS ) & +MXR_INT_STATUS_VSYNC ),50 ); +if (ret <0 ) +DRM_DEBUG_KMS ("vblank wait timed out.\n" ); +} +static void mixer_win_mode_set (void *ctx,struct exynos_drm_overlay *overlay) {
@@ -818,6 +830,7 @@ static struct exynos_mixer_ops mixer_ops = { .dpms = mixer_dpms,/* overlay */ + .wait_for_vblank = mixer_wait_for_vblank, .win_mode_set = mixer_win_mode_set, .win_commit = mixer_win_commit, .win_disable = mixer_win_disable,
Signature · 1 line
1.7.4.1