* [PATCH] lib/igt_kms: Introduce get_first_connected_output to retrieve a valid output
@ 2015-10-29 2:09 Vivek Kasireddy
2015-10-29 11:05 ` Thomas Wood
0 siblings, 1 reply; 11+ messages in thread
From: Vivek Kasireddy @ 2015-10-29 2:09 UTC (permalink / raw)
To: intel-gfx; +Cc: Vivek Kasireddy
In some cases, we just need one valid output to perform a test.
This macro can help in these situations by avoiding iterating
over all the outputs.
Suggested-by: Matt Roper <matthew.d.roper@intel.com>
CC: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
CC: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
lib/igt_kms.h | 5 +++++
tests/kms_rotation_crc.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 09c08aa..6847beb 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -278,6 +278,11 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \
i__ < (display)->pipes[(pipe)].n_planes; i__++)
+#define get_first_connected_output(display, output) \
+ for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
+ if ((output = &(display)->outputs[i__]), output->valid) \
+ break
+
/*
* Can be used with igt_output_set_pipe() to mean we don't care about the pipe
* that should drive this output
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 31cece2..3f0a3ef 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -272,14 +272,15 @@ static void test_plane_rotation_ytiled_obj(data_t *data, enum igt_plane plane_ty
int bpp = igt_drm_format_to_bpp(format);
enum igt_commit_style commit = COMMIT_LEGACY;
int fd = data->gfx_fd;
- igt_output_t *output = &display->outputs[0];
+ igt_output_t *output = NULL;
igt_plane_t *plane;
drmModeModeInfo *mode;
unsigned int stride, size, w, h;
uint32_t gem_handle;
int ret;
- igt_require(output != NULL && output->valid == true);
+ get_first_connected_output(display, output);
+ igt_require(output != NULL);
plane = igt_output_get_plane(output, plane_type);
igt_require(igt_plane_supports_rotation(plane));
--
2.4.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] lib/igt_kms: Introduce get_first_connected_output to retrieve a valid output
2015-10-29 2:09 [PATCH] lib/igt_kms: Introduce get_first_connected_output to retrieve a valid output Vivek Kasireddy
@ 2015-10-29 11:05 ` Thomas Wood
2015-11-05 1:34 ` [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2) Vivek Kasireddy
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Wood @ 2015-10-29 11:05 UTC (permalink / raw)
To: Vivek Kasireddy; +Cc: Intel Graphics Development
On 29 October 2015 at 02:09, Vivek Kasireddy <vivek.kasireddy@intel.com> wrote:
> In some cases, we just need one valid output to perform a test.
> This macro can help in these situations by avoiding iterating
> over all the outputs.
>
> Suggested-by: Matt Roper <matthew.d.roper@intel.com>
> CC: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> CC: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
> lib/igt_kms.h | 5 +++++
> tests/kms_rotation_crc.c | 5 +++--
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 09c08aa..6847beb 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -278,6 +278,11 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
> for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \
> i__ < (display)->pipes[(pipe)].n_planes; i__++)
>
Please add some API documentation here.
> +#define get_first_connected_output(display, output) \
> + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
> + if ((output = &(display)->outputs[i__]), output->valid) \
> + break
> +
> /*
> * Can be used with igt_output_set_pipe() to mean we don't care about the pipe
> * that should drive this output
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 31cece2..3f0a3ef 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -272,14 +272,15 @@ static void test_plane_rotation_ytiled_obj(data_t *data, enum igt_plane plane_ty
> int bpp = igt_drm_format_to_bpp(format);
> enum igt_commit_style commit = COMMIT_LEGACY;
> int fd = data->gfx_fd;
> - igt_output_t *output = &display->outputs[0];
> + igt_output_t *output = NULL;
> igt_plane_t *plane;
> drmModeModeInfo *mode;
> unsigned int stride, size, w, h;
> uint32_t gem_handle;
> int ret;
>
> - igt_require(output != NULL && output->valid == true);
> + get_first_connected_output(display, output);
> + igt_require(output != NULL);
>
> plane = igt_output_get_plane(output, plane_type);
> igt_require(igt_plane_supports_rotation(plane));
> --
> 2.4.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2)
2015-10-29 11:05 ` Thomas Wood
@ 2015-11-05 1:34 ` Vivek Kasireddy
2015-11-13 15:59 ` Thomas Wood
0 siblings, 1 reply; 11+ messages in thread
From: Vivek Kasireddy @ 2015-11-05 1:34 UTC (permalink / raw)
To: intel-gfx; +Cc: Vivek Kasireddy, Thomas Wood
In some cases, we just need one valid (connected) output to perform
a test. This macro can help in these situations by not having to
put the test code inside a for loop that iterates over all the outputs.
v2: Added a brief documentation for this macro.
Suggested-by: Matt Roper <matthew.d.roper at intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
lib/igt_kms.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 09c08aa..91fa206 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -278,6 +278,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \
i__ < (display)->pipes[(pipe)].n_planes; i__++)
+/**
+ * get_first_connected_output:
+ * @display: Initialized igt_display_t type object
+ * @output: igt_output_t type object
+ *
+ * Returns: First valid (connected) output.
+ */
+#define get_first_connected_output(display, output) \
+ for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
+ if ((output = &(display)->outputs[i__]), output->valid) \
+ break
+
/*
* Can be used with igt_output_set_pipe() to mean we don't care about the pipe
* that should drive this output
--
2.4.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2)
2015-11-05 1:34 ` [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2) Vivek Kasireddy
@ 2015-11-13 15:59 ` Thomas Wood
2015-11-14 3:08 ` Vivek Kasireddy
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Wood @ 2015-11-13 15:59 UTC (permalink / raw)
To: Vivek Kasireddy; +Cc: Intel Graphics Development
On 5 November 2015 at 01:34, Vivek Kasireddy <vivek.kasireddy@intel.com> wrote:
> In some cases, we just need one valid (connected) output to perform
> a test. This macro can help in these situations by not having to
> put the test code inside a for loop that iterates over all the outputs.
>
> v2: Added a brief documentation for this macro.
The new macro is no longer being used anywhere. Is there a new patch
that uses the macro?
Also, if re-sending the patch, please make sure it is tagged correctly
as described in:
http://lists.freedesktop.org/archives/intel-gfx/2015-November/079712.html
This also explains how to manage the version tag in the subject line.
>
> Suggested-by: Matt Roper <matthew.d.roper at intel.com>
> Cc: Thomas Wood <thomas.wood@intel.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
> lib/igt_kms.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 09c08aa..91fa206 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -278,6 +278,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
> for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \
> i__ < (display)->pipes[(pipe)].n_planes; i__++)
>
> +/**
> + * get_first_connected_output:
> + * @display: Initialized igt_display_t type object
> + * @output: igt_output_t type object
> + *
> + * Returns: First valid (connected) output.
> + */
> +#define get_first_connected_output(display, output) \
> + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
> + if ((output = &(display)->outputs[i__]), output->valid) \
> + break
> +
> /*
> * Can be used with igt_output_set_pipe() to mean we don't care about the pipe
> * that should drive this output
> --
> 2.4.3
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2)
2015-11-13 15:59 ` Thomas Wood
@ 2015-11-14 3:08 ` Vivek Kasireddy
2015-11-16 13:30 ` Thomas Wood
0 siblings, 1 reply; 11+ messages in thread
From: Vivek Kasireddy @ 2015-11-14 3:08 UTC (permalink / raw)
To: Thomas Wood; +Cc: Intel Graphics Development
On Fri, 13 Nov 2015 15:59:21 +0000
Thomas Wood <thomas.wood@intel.com> wrote:
> On 5 November 2015 at 01:34, Vivek Kasireddy
> <vivek.kasireddy@intel.com> wrote:
> > In some cases, we just need one valid (connected) output to perform
> > a test. This macro can help in these situations by not having to
> > put the test code inside a for loop that iterates over all the
> > outputs.
> >
> > v2: Added a brief documentation for this macro.
>
> The new macro is no longer being used anywhere. Is there a new patch
> that uses the macro?
>
Hi Thomas,
I wanted to have this patch merged before I updated the tests to use
the macro.
>
> Also, if re-sending the patch, please make sure it is tagged correctly
> as described in:
>
> http://lists.freedesktop.org/archives/intel-gfx/2015-November/079712.html
>
> This also explains how to manage the version tag in the subject line.
Thanks for the link; I wasn't aware of it. Do you want me to resend the
patch in this format?
Thanks and Regards,
Vivek
>
>
> >
> > Suggested-by: Matt Roper <matthew.d.roper at intel.com>
> > Cc: Thomas Wood <thomas.wood@intel.com>
> > Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> > ---
> > lib/igt_kms.h | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> > index 09c08aa..91fa206 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -278,6 +278,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe
> > pipe); for (int i__ = 0; (plane) =
> > &(display)->pipes[(pipe)].planes[i__], \ i__ <
> > (display)->pipes[(pipe)].n_planes; i__++)
> >
> > +/**
> > + * get_first_connected_output:
> > + * @display: Initialized igt_display_t type object
> > + * @output: igt_output_t type object
> > + *
> > + * Returns: First valid (connected) output.
> > + */
> > +#define get_first_connected_output(display, output) \
> > + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
> > + if ((output = &(display)->outputs[i__]),
> > output->valid) \
> > + break
> > +
> > /*
> > * Can be used with igt_output_set_pipe() to mean we don't care
> > about the pipe
> > * that should drive this output
> > --
> > 2.4.3
> >
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2)
2015-11-14 3:08 ` Vivek Kasireddy
@ 2015-11-16 13:30 ` Thomas Wood
2015-11-21 2:56 ` [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro Vivek Kasireddy
2015-11-21 2:58 ` [PATCH i-g-t] tests/kms_rotation_crc: Use " Vivek Kasireddy
0 siblings, 2 replies; 11+ messages in thread
From: Thomas Wood @ 2015-11-16 13:30 UTC (permalink / raw)
To: Vivek Kasireddy; +Cc: Intel Graphics Development
On 14 November 2015 at 03:08, Vivek Kasireddy <vivek.kasireddy@intel.com> wrote:
> On Fri, 13 Nov 2015 15:59:21 +0000
> Thomas Wood <thomas.wood@intel.com> wrote:
>
>> On 5 November 2015 at 01:34, Vivek Kasireddy
>> <vivek.kasireddy@intel.com> wrote:
>> > In some cases, we just need one valid (connected) output to perform
>> > a test. This macro can help in these situations by not having to
>> > put the test code inside a for loop that iterates over all the
>> > outputs.
>> >
>> > v2: Added a brief documentation for this macro.
>>
>> The new macro is no longer being used anywhere. Is there a new patch
>> that uses the macro?
>>
>
> Hi Thomas,
> I wanted to have this patch merged before I updated the tests to use
> the macro.
>
>>
>> Also, if re-sending the patch, please make sure it is tagged correctly
>> as described in:
>>
>> http://lists.freedesktop.org/archives/intel-gfx/2015-November/079712.html
>>
>> This also explains how to manage the version tag in the subject line.
>
> Thanks for the link; I wasn't aware of it. Do you want me to resend the
> patch in this format?
Just resend it with the patches that use the macro so that they can
all be reviewed and applied together.
>
> Thanks and Regards,
> Vivek
>
>>
>>
>> >
>> > Suggested-by: Matt Roper <matthew.d.roper at intel.com>
>> > Cc: Thomas Wood <thomas.wood@intel.com>
>> > Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
>> > ---
>> > lib/igt_kms.h | 12 ++++++++++++
>> > 1 file changed, 12 insertions(+)
>> >
>> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h
>> > index 09c08aa..91fa206 100644
>> > --- a/lib/igt_kms.h
>> > +++ b/lib/igt_kms.h
>> > @@ -278,6 +278,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe
>> > pipe); for (int i__ = 0; (plane) =
>> > &(display)->pipes[(pipe)].planes[i__], \ i__ <
>> > (display)->pipes[(pipe)].n_planes; i__++)
>> >
>> > +/**
>> > + * get_first_connected_output:
>> > + * @display: Initialized igt_display_t type object
>> > + * @output: igt_output_t type object
>> > + *
>> > + * Returns: First valid (connected) output.
>> > + */
>> > +#define get_first_connected_output(display, output) \
>> > + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
>> > + if ((output = &(display)->outputs[i__]),
>> > output->valid) \
>> > + break
>> > +
>> > /*
>> > * Can be used with igt_output_set_pipe() to mean we don't care
>> > about the pipe
>> > * that should drive this output
>> > --
>> > 2.4.3
>> >
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro
2015-11-16 13:30 ` Thomas Wood
@ 2015-11-21 2:56 ` Vivek Kasireddy
2015-11-23 13:49 ` Ander Conselvan De Oliveira
2015-11-24 13:03 ` Ville Syrjälä
2015-11-21 2:58 ` [PATCH i-g-t] tests/kms_rotation_crc: Use " Vivek Kasireddy
1 sibling, 2 replies; 11+ messages in thread
From: Vivek Kasireddy @ 2015-11-21 2:56 UTC (permalink / raw)
To: intel-gfx; +Cc: Vivek Kasireddy, Thomas Wood
In some cases, we just need one valid (connected) output to perform
a test. This macro can help in these situations by not having to
put the test code inside a for loop that iterates over all the outputs.
v2: Added a brief documentation for this macro.
Suggested-by: Matt Roper <matthew.d.roper at intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
lib/igt_kms.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 965c47c..a0bb066 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -279,6 +279,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \
i__ < (display)->pipes[(pipe)].n_planes; i__++)
+/**
+ * get_first_connected_output:
+ * @display: Initialized igt_display_t type object
+ * @output: igt_output_t type object
+ *
+ * Returns: First valid (connected) output.
+ */
+#define get_first_connected_output(display, output) \
+ for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
+ if ((output = &(display)->outputs[i__]), output->valid) \
+ break
+
#define IGT_FIXED(i,f) ((i) << 16 | (f))
void igt_enable_connectors(void);
--
2.4.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH i-g-t] tests/kms_rotation_crc: Use get_first_connected_output macro
2015-11-16 13:30 ` Thomas Wood
2015-11-21 2:56 ` [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro Vivek Kasireddy
@ 2015-11-21 2:58 ` Vivek Kasireddy
1 sibling, 0 replies; 11+ messages in thread
From: Vivek Kasireddy @ 2015-11-21 2:58 UTC (permalink / raw)
To: intel-gfx; +Cc: Vivek Kasireddy
In some cases, the only connected connector might not occupy the
first slot and hence output[0] might be empty. Therefore, use
the get_first_connected_output macro to find the output object
associated with the connected connector.
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
tests/kms_rotation_crc.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index c3241cf..94b4486 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -323,14 +323,15 @@ static void test_plane_rotation_ytiled_obj(data_t *data, enum igt_plane plane_ty
int bpp = igt_drm_format_to_bpp(format);
enum igt_commit_style commit = COMMIT_LEGACY;
int fd = data->gfx_fd;
- igt_output_t *output = &display->outputs[0];
+ igt_output_t *output = NULL;
igt_plane_t *plane;
drmModeModeInfo *mode;
unsigned int stride, size, w, h;
uint32_t gem_handle;
int ret;
- igt_require(output != NULL && output->valid == true);
+ get_first_connected_output(display, output);
+ igt_require(output != NULL);
plane = igt_output_get_plane(output, plane_type);
igt_require(igt_plane_supports_rotation(plane));
@@ -385,7 +386,7 @@ static void test_plane_rotation_exhaust_fences(data_t *data, enum igt_plane plan
int bpp = igt_drm_format_to_bpp(format);
enum igt_commit_style commit = COMMIT_LEGACY;
int fd = data->gfx_fd;
- igt_output_t *output = &display->outputs[0];
+ igt_output_t *output = NULL;
igt_plane_t *plane;
drmModeModeInfo *mode;
data_t data2[MAX_FENCES+1] = {};
@@ -394,7 +395,8 @@ static void test_plane_rotation_exhaust_fences(data_t *data, enum igt_plane plan
uint64_t total_aperture_size, total_fbs_size;
int i, ret;
- igt_require(output != NULL && output->valid == true);
+ get_first_connected_output(display, output);
+ igt_require(output != NULL);
plane = igt_output_get_plane(output, plane_type);
igt_require(igt_plane_supports_rotation(plane));
--
2.4.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro
2015-11-21 2:56 ` [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro Vivek Kasireddy
@ 2015-11-23 13:49 ` Ander Conselvan De Oliveira
2015-11-24 12:20 ` Daniel Vetter
2015-11-24 13:03 ` Ville Syrjälä
1 sibling, 1 reply; 11+ messages in thread
From: Ander Conselvan De Oliveira @ 2015-11-23 13:49 UTC (permalink / raw)
To: Vivek Kasireddy, intel-gfx; +Cc: Thomas Wood
On Fri, 2015-11-20 at 18:56 -0800, Vivek Kasireddy wrote:
> In some cases, we just need one valid (connected) output to perform
> a test. This macro can help in these situations by not having to
> put the test code inside a for loop that iterates over all the outputs.
>
> v2: Added a brief documentation for this macro.
>
> Suggested-by: Matt Roper <matthew.d.roper at intel.com>
> Cc: Thomas Wood <thomas.wood@intel.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
> lib/igt_kms.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 965c47c..a0bb066 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -279,6 +279,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
> for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \
> i__ < (display)->pipes[(pipe)].n_planes; i__++)
>
> +/**
> + * get_first_connected_output:
> + * @display: Initialized igt_display_t type object
> + * @output: igt_output_t type object
> + *
> + * Returns: First valid (connected) output.
> + */
> +#define get_first_connected_output(display, output) \
> + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
> + if ((output = &(display)->outputs[i__]), output->valid) \
> + break
> +
Is it possible that there is no valid output?
Ander
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro
2015-11-23 13:49 ` Ander Conselvan De Oliveira
@ 2015-11-24 12:20 ` Daniel Vetter
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Vetter @ 2015-11-24 12:20 UTC (permalink / raw)
To: Ander Conselvan De Oliveira; +Cc: intel-gfx, Vivek Kasireddy, Thomas Wood
On Mon, Nov 23, 2015 at 03:49:20PM +0200, Ander Conselvan De Oliveira wrote:
> On Fri, 2015-11-20 at 18:56 -0800, Vivek Kasireddy wrote:
> > In some cases, we just need one valid (connected) output to perform
> > a test. This macro can help in these situations by not having to
> > put the test code inside a for loop that iterates over all the outputs.
> >
> > v2: Added a brief documentation for this macro.
> >
> > Suggested-by: Matt Roper <matthew.d.roper at intel.com>
> > Cc: Thomas Wood <thomas.wood@intel.com>
> > Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> > ---
> > lib/igt_kms.h | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> > index 965c47c..a0bb066 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -279,6 +279,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
> > for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \
> > i__ < (display)->pipes[(pipe)].n_planes; i__++)
> >
> > +/**
> > + * get_first_connected_output:
> > + * @display: Initialized igt_display_t type object
> > + * @output: igt_output_t type object
> > + *
> > + * Returns: First valid (connected) output.
> > + */
> > +#define get_first_connected_output(display, output) \
> > + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
> > + if ((output = &(display)->outputs[i__]), output->valid) \
> > + break
> > +
>
> Is it possible that there is no valid output?
>
We also need to check at least crtc restrictions, otherwise bsw will fall
over mightly. Or well anything with MIPI DSI encoders.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro
2015-11-21 2:56 ` [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro Vivek Kasireddy
2015-11-23 13:49 ` Ander Conselvan De Oliveira
@ 2015-11-24 13:03 ` Ville Syrjälä
1 sibling, 0 replies; 11+ messages in thread
From: Ville Syrjälä @ 2015-11-24 13:03 UTC (permalink / raw)
To: Vivek Kasireddy; +Cc: intel-gfx, Thomas Wood
On Fri, Nov 20, 2015 at 06:56:50PM -0800, Vivek Kasireddy wrote:
> In some cases, we just need one valid (connected) output to perform
> a test. This macro can help in these situations by not having to
> put the test code inside a for loop that iterates over all the outputs.
>
> v2: Added a brief documentation for this macro.
>
> Suggested-by: Matt Roper <matthew.d.roper at intel.com>
> Cc: Thomas Wood <thomas.wood@intel.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
> lib/igt_kms.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 965c47c..a0bb066 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -279,6 +279,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
> for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \
> i__ < (display)->pipes[(pipe)].n_planes; i__++)
>
> +/**
> + * get_first_connected_output:
> + * @display: Initialized igt_display_t type object
> + * @output: igt_output_t type object
> + *
> + * Returns: First valid (connected) output.
> + */
> +#define get_first_connected_output(display, output) \
> + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \
> + if ((output = &(display)->outputs[i__]), output->valid) \
> + break
Why is this a fragile macro instead of a simple function that just
returns what we need?
> +
> #define IGT_FIXED(i,f) ((i) << 16 | (f))
>
> void igt_enable_connectors(void);
> --
> 2.4.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-11-24 13:03 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-29 2:09 [PATCH] lib/igt_kms: Introduce get_first_connected_output to retrieve a valid output Vivek Kasireddy
2015-10-29 11:05 ` Thomas Wood
2015-11-05 1:34 ` [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2) Vivek Kasireddy
2015-11-13 15:59 ` Thomas Wood
2015-11-14 3:08 ` Vivek Kasireddy
2015-11-16 13:30 ` Thomas Wood
2015-11-21 2:56 ` [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro Vivek Kasireddy
2015-11-23 13:49 ` Ander Conselvan De Oliveira
2015-11-24 12:20 ` Daniel Vetter
2015-11-24 13:03 ` Ville Syrjälä
2015-11-21 2:58 ` [PATCH i-g-t] tests/kms_rotation_crc: Use " Vivek Kasireddy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.