Re: [PATCH v4 27/28] media: iris: enable video driver probe of SM8250 SoC
From: Dikshita Agarwal
Date: Fri Oct 25 2024 - 03:04:13 EST
Hi Dmitry,
On 10/15/2024 5:56 PM, Dmitry Baryshkov wrote:
> On Tue, 15 Oct 2024 at 12:22, Dikshita Agarwal
> <quic_dikshita@xxxxxxxxxxx> wrote:
>>
>>
>>
>> On 10/14/2024 7:38 PM, Dmitry Baryshkov wrote:
>>> On Mon, Oct 14, 2024 at 10:00:21PM +0800, Jianhua Lu wrote:
>>>> On Mon, Oct 14, 2024 at 02:37:48PM +0530, Dikshita Agarwal wrote:
>>>>> Initialize the platform data and enable video driver
>>>>> probe of SM8250 SoC.
>>>>>
>>>>> Signed-off-by: Dikshita Agarwal <quic_dikshita@xxxxxxxxxxx>
>>>>> ---
>>>> [..]
>>>>> diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
>>>>> index 86ef2e5c488e..a2aadd48926f 100644
>>>>> --- a/drivers/media/platform/qcom/iris/iris_probe.c
>>>>> +++ b/drivers/media/platform/qcom/iris/iris_probe.c
>>>>> @@ -325,6 +325,10 @@ static const struct of_device_id iris_dt_match[] = {
>>>>> .compatible = "qcom,sm8550-iris",
>>>>> .data = &sm8550_data,
>>>>> },
>>>>> + {
>>>>> + .compatible = "qcom,sm8250-venus",
>>>>> + .data = &sm8250_data,
>>>>> + },
>>>>> { },
>>>>> };
>>>>> MODULE_DEVICE_TABLE(of, iris_dt_match);
>>>>
>>>> qcom-venus driver has already supported sm8250 soc, I think you should add
>>>> an extra patch to drop sm8250 releated code from qcom-venus driver if you
>>>> tend to add support for sm8250 in qcom-iris driver.
>>>
>>> Iris driver did not feature parity with the venus driver, so it is
>>> expected that two drivers will exist side by side for some time.
>>> Nevertheless ideally we should have a way to specify which driver should
>>> be used for sm8250 (and other platforms being migrated).
>>>
>> Agree, we should have a way to specify this. Any suggestions to achieve
>> this are welcomed.
>
> See how this is handled for the drm/msm/mdp5 vs dpu drivers.
>
We are also thinking to handle this as combination of compatible + module
param similar to display driver, like below:
static bool prefer_venus = true;
MODULE_PARM_DESC(prefer_venus, "Select whether venus or iris driver should
be preferred");
module_param(prefer_venus, bool, 0444);
/* list all platforms supported by only iris driver */
static const char *const iris_only_platforms[] = {
"qcom,sm8550-iris",
NULL,
};
/* list all platforms supported by both venus and iris drivers */
static const char *const venus_to_iris_migration[] = {
"qcom,sm8250-venus",
NULL,
};
static bool video_drv_should_bind(struct device *dev, bool iris_driver)
{
if (of_device_compatible_match(dev->of_node, iris_only_platforms))
return iris_driver;
/* If it is not in the migration list, use venus */
if (!of_device_compatible_match(dev->of_node, venus_to_iris_migration))
return !iris_driver;
return prefer_venus ? !iris_driver : iris_driver;
}
And invoke "video_drv_should_bind" API in iris driver probe.
Please see if this approach looks good to you.
Thanks,
Dikshita