Skip to contentSkip to conversation

adv7511: Added mode_fixup function.

PATCH In review Carlos Palminha 4 participants 8 messages Jan 29, 2016 – Feb 10, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 adv7511: Added mode_fixup function.

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,
 	.detect = adv7511_encoder_detect,
Signature · 1 line
2.5.0
#1 lore raw

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Quoted 32 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Hi Laurent

Quoted 9 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Probably you are right but i don't have enough knowledge or time to do that for the DRM framework. :( I limited myself to do what the other drivers already implement.

The patch is mandatory to have to the ADV working or else will get some NULL pointer crash.

Regards,
C.Palminha

Quoted 34 lines
Quoted 33 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Quoted 43 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Quoted 32 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

#3 lore raw

Hi guys,

any feedback? patch will be accepted for adv7511 driver?

Regards,
C.Palminha

Quoted 100 lines · Carlos Palminha

Hi Laurent

Quoted 9 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Probably you are right but i don't have enough knowledge or time to do that for the DRM framework. :( I limited myself to do what the other drivers already implement.

The patch is mandatory to have to the ADV working or else will get some NULL pointer crash.

Regards,
C.Palminha

Quoted 34 lines
Quoted 33 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Quoted 43 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Quoted 32 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

#4 lore raw
Quoted 3 lines · Carlos Palminha

Hi guys,

any feedback? patch will be accepted for adv7511 driver?

Hi,

Thanks for the patch, but please try to find and fix the call site that is trying to invoke the callback even though it does not exist.

This is most likely drm_i2c_encoder_mode_fixup().

- Lars

Quoted 110 lines

Regards,
C.Palminha

Quoted 56 lines · Carlos Palminha

Hi Laurent

Quoted 9 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Probably you are right but i don't have enough knowledge or time to do that for the DRM framework. :( I limited myself to do what the other drivers already implement.

The patch is mandatory to have to the ADV working or else will get some NULL pointer crash.

Regards,
C.Palminha

Quoted 27 lines
Quoted 27 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +7 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
Quoted 7 lines
Quoted 6 lines
drivers/gpu/drm/i2c/adv7511.c +1 -0
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Quoted 44 lines
Quoted 43 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Quoted 32 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
Quoted 11 lines · Lars-Peter Clausen
Quoted 3 lines · Carlos Palminha

Hi guys,

any feedback? patch will be accepted for adv7511 driver?

Hi,

Thanks for the patch, but please try to find and fix the call site that is trying to invoke the callback even though it does not exist.

This is most likely drm_i2c_encoder_mode_fixup().

Agreed, this should be fixed in the helper library, not in drivers by copypasting piles more dummy functions.
-Daniel

Quoted 118 lines

- Lars

Quoted 105 lines

Regards,
C.Palminha

Quoted 56 lines · Carlos Palminha

Hi Laurent

Quoted 9 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Probably you are right but i don't have enough knowledge or time to do that for the DRM framework. :( I limited myself to do what the other drivers already implement.

The patch is mandatory to have to the ADV working or else will get some NULL pointer crash.

Regards,
C.Palminha

Quoted 27 lines
Quoted 27 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +7 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
Quoted 7 lines
Quoted 6 lines
drivers/gpu/drm/i2c/adv7511.c +1 -0
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Quoted 44 lines
Quoted 43 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Quoted 32 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Quoted 5 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

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

Hi guys,

I agree that this should be fixed in the helper library.
There are already a lot of drivers that copy/paste code and several helper functions that do not avoid it.

I will start sending some patches to fix this type of issue in several places of DRM helper functions.

Regards,
C.Palminha

Quoted 136 lines · Daniel Vetter
Quoted 11 lines · Lars-Peter Clausen
Quoted 3 lines · Carlos Palminha

Hi guys,

any feedback? patch will be accepted for adv7511 driver?

Hi,

Thanks for the patch, but please try to find and fix the call site that is trying to invoke the callback even though it does not exist.

This is most likely drm_i2c_encoder_mode_fixup().

Agreed, this should be fixed in the helper library, not in drivers by copypasting piles more dummy functions.
-Daniel

Quoted 118 lines

- Lars

Quoted 105 lines

Regards,
C.Palminha

Quoted 56 lines · Carlos Palminha

Hi Laurent

Quoted 9 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Probably you are right but i don't have enough knowledge or time to do that for the DRM framework. :( I limited myself to do what the other drivers already implement.

The patch is mandatory to have to the ADV working or else will get some NULL pointer crash.

Regards,
C.Palminha

Quoted 27 lines
Quoted 27 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +7 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
Quoted 7 lines
Quoted 6 lines
drivers/gpu/drm/i2c/adv7511.c +1 -0
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Quoted 44 lines
Quoted 43 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Quoted 32 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Quoted 5 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

#7 lore raw
Quoted 6 lines · Carlos Palminha

Hi guys,

I agree that this should be fixed in the helper library.
There are already a lot of drivers that copy/paste code and several helper functions that do not avoid it.

I will start sending some patches to fix this type of issue in several places of DRM helper functions.

Awesome, thanks a lot for doing this.
-Daniel

Quoted 145 lines

Regards,
C.Palminha

Quoted 8 lines · Daniel Vetter
Quoted 7 lines · Lars-Peter Clausen
Quoted 3 lines · Carlos Palminha

Hi guys,

any feedback? patch will be accepted for adv7511 driver?

Hi,

Quoted 128 lines
Quoted 4 lines

Thanks for the patch, but please try to find and fix the call site that is trying to invoke the callback even though it does not exist.

This is most likely drm_i2c_encoder_mode_fixup().

Agreed, this should be fixed in the helper library, not in drivers by copypasting piles more dummy functions.
-Daniel

Quoted 118 lines

- Lars

Quoted 105 lines

Regards,
C.Palminha

Quoted 56 lines · Carlos Palminha

Hi Laurent

Quoted 9 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Probably you are right but i don't have enough knowledge or time to do that for the DRM framework. :( I limited myself to do what the other drivers already implement.

The patch is mandatory to have to the ADV working or else will get some NULL pointer crash.

Regards,
C.Palminha

Quoted 27 lines
Quoted 27 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +7 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
Quoted 7 lines
Quoted 6 lines
drivers/gpu/drm/i2c/adv7511.c +1 -0
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Quoted 44 lines
Quoted 43 lines · Laurent Pinchart

Hi Carlos,

Thank you for the patch.

Quoted 1 line · On Friday 29 January 2016 10:33:47 Carlos Palminha wrote:

The mode_fixup is necessary when using it in a DRM FB driver pipeline.

Instead of implementing stubs in encoder drivers, wouldn't it be better to make mode_fixup optional ?

Quoted 32 lines
---
 drivers/gpu/drm/i2c/adv7511.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i2c/adv7511.c +8 -0
index 533d1e3..90082d2 100644
@@ -648,6 +648,13 @@ adv7511_encoder_detect(struct drm_encoder *encoder,
 	return status;
 }
 
+static bool adv7511_encoder_mode_fixup(struct drm_encoder *encoder,
+					const struct drm_display_mode *mode,
+					struct drm_display_mode *adjusted_mode)
+{
+	return true;
+}
+
 static int adv7511_encoder_mode_valid(struct drm_encoder *encoder,
 				      struct drm_display_mode *mode)
 {
@@ -754,6 +761,7 @@ static void adv7511_encoder_mode_set(struct drm_encoder
 *encoder,
 
 static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = {
 	.dpms = adv7511_encoder_dpms,
+	.mode_fixup = adv7511_encoder_mode_fixup,
 	.mode_valid = adv7511_encoder_mode_valid,
 	.mode_set = adv7511_encoder_mode_set,

.detect = adv7511_encoder_detect,

Quoted 5 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

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel