[libcamera-devel] [PATCH] cam: kms_sink: Print display pipeline configuration

Umang Jain umang.jain at ideasonboard.com
Tue Oct 5 07:06:43 CEST 2021


Hi Laurent,

On 10/4/21 10:50 AM, paul.elder at ideasonboard.com wrote:
> Hi Laurent,
>
> On Sun, Oct 03, 2021 at 05:46:00PM +0300, Laurent Pinchart wrote:
>> It can be useful, for diagnosis purpose, to know what plane and CRTC the
>> KMS sink auto-selects. Print the display pipeline configuration at start
>> time.
>>
>> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>


Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>

>
>> ---
>>   src/cam/kms_sink.cpp | 21 +++++++++++++++------
>>   1 file changed, 15 insertions(+), 6 deletions(-)
>>
>> diff --git a/src/cam/kms_sink.cpp b/src/cam/kms_sink.cpp
>> index 658192efc105..d30fba783c96 100644
>> --- a/src/cam/kms_sink.cpp
>> +++ b/src/cam/kms_sink.cpp
>> @@ -174,24 +174,33 @@ int KMSSink::configurePipeline(const libcamera::PixelFormat &format)
>>   					crtc_ = crtc;
>>   					plane_ = plane;
>>   					format_ = format;
>> -					return 0;
>> +					break;
>>   				}
>>   
>>   				if (plane->supportsFormat(xFormat)) {
>>   					crtc_ = crtc;
>>   					plane_ = plane;
>>   					format_ = xFormat;
>> -					return 0;
>> +					break;
>>   				}
>>   			}
>>   		}
>>   	}
>>   
>> -	std::cerr
>> -		<< "Unable to find display pipeline for format "
>> -		<< format.toString() << std::endl;
>> +	if (!crtc_) {
>> +		std::cerr
>> +			<< "Unable to find display pipeline for format "
>> +			<< format.toString() << std::endl;
>>   
>> -	return -EPIPE;
>> +		return -EPIPE;
>> +	}
>> +
>> +	std::cout
>> +		<< "Using KMS plane " << plane_->id() << ", CRTC " << crtc_->id()
>> +		<< ", connector " << connector_->name()
>> +		<< " (" << connector_->id() << ")" << std::endl;
>> +
>> +	return 0;
>>   }
>>   
>>   int KMSSink::start()
>>
>> base-commit: c286b00aa1eb9331c3bab2b35905dcf2e4ccde66
> What's all this?
I ' ve noticed this in earlier patches, assumed it was intentional 
marker to track dev-branches locally


More information about the libcamera-devel mailing list