Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Joshi, Kunal1" <kunal1.joshi@intel.com>
To: "Modem, Bhanuprakash" <bhanuprakash.modem@intel.com>,
	<igt-dev@lists.freedesktop.org>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Ankit Nautiyal" <ankit.k.nautiyal@intel.com>
Subject: Re: [PATCH i-g-t 4/7] lib/igt_kms: add support for forcing bigjoiner on particular connector
Date: Fri, 19 Apr 2024 17:04:26 +0530	[thread overview]
Message-ID: <f7506aba-28cd-4e27-bbd0-b62afc081efd@intel.com> (raw)
In-Reply-To: <34c9cf2e-ac0c-42bc-8b18-b6ec1728a908@intel.com>

Hello,

On 4/19/2024 3:56 PM, Modem, Bhanuprakash wrote:
>
> On 19-04-2024 12:09 pm, Kunal Joshi wrote:
>> add kmstest_force_connector_bigjoiner function which
>> force bigjoiner on provided connector as well as resets on exit.
>>
>> v2: remove redundant function (Bhanu)
>>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
>> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
>> ---
>>   lib/igt_kms.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>   lib/igt_kms.h |  1 +
>>   2 files changed, 70 insertions(+)
>>
>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
>> index 378c97f88..324b0527f 100644
>> --- a/lib/igt_kms.c
>> +++ b/lib/igt_kms.c
>> @@ -1607,6 +1607,32 @@ static bool connector_attr_set_sysfs(int drm_fd,
>>       return true;
>>   }
>>   +static bool connector_attr_set_debugfs(int drm_fd,
>
> How connector_attr_set_debugfs() is different than 
> connector_attr_set_sysfs()?
>
>> +                       drmModeConnector *connector,
>> +                       const char *attr, const char *value,
>> +                       const char *reset_value)
>> +{
>> +    char name[80];
>> +    int idx, dir;
>> +
>> +    snprintf(name, sizeof(name), "%s-%d",
>> + kmstest_connector_type_str(connector->connector_type),
>> +         connector->connector_type_id);
Above differs
>>
>> +
>> +    dir = igt_debugfs_connector_dir(drm_fd, name, O_DIRECTORY);
above differs
>> +    if (dir < 0)
>> +        return false;
>> +
>> +    if (!connector_attr_set(idx, connector, dir,
> --------------------------------^
> Passing uninitialized idx?
Hmm, not sure how could this work still,
Will assign proper value to idx in next revision.


Thanks and Regards
Kunal Joshi

>> +                igt_sysfs_set, attr,
>> +                value, reset_value))
>> +        return false;
>> +
>> +    igt_info("Connector %s/%s is now %s\n", name, attr, value);
>> +
>> +    return true;
>> +}
>> +
>>   static void dump_connector_attrs(void)
>>   {
>>       char name[80];
>> @@ -1690,6 +1716,49 @@ bool kmstest_force_connector(int drm_fd, 
>> drmModeConnector *connector,
>>       return true;
>>   }
>>   +static bool force_connector_bigjoiner(int drm_fd,
>> +                      drmModeConnector *connector,
>> +                      const char *value)
>> +{
>> +    return connector_attr_set_debugfs(drm_fd, connector,
>> +                      "i915_bigjoiner_force_enable",
>> +                      value, "0");
>> +}
>> +
>> +/**
>> + * kmstest_force_connector_bigjoiner:
>> + * @fd: drm file descriptor
>> + * @connector: connector
>> + *
>> + * Enable force bigjoiner state on the specified connector
>> + * and install exit handler for resetting
>> + *
>> + * Returns: True on success
>> + */
>> +bool kmstest_force_connector_bigjoiner(int drm_fd, drmModeConnector 
>> *connector)
>> +{
>> +    const char *value = "1";
>> +    drmModeConnector *temp;
>> +
>> +    if (!is_intel_device(drm_fd))
>> +        return false;
>> +
>> +    if (!force_connector_bigjoiner(drm_fd, connector, value))
>> +        return false;
>> +
>> +    dump_connector_attrs();
>> +    igt_install_exit_handler(reset_connectors_at_exit);
> ---------------------------------^
> This will reset all connectors, Instead of resetting all connectors 
> I'm expecting to reset a particular one. Maybe we can take this as a 
> separate activity.
>
> - Bhanu
>
>> +
>> +    /*
>> +     * To allow callers to always use GetConnectorCurrent we need to 
>> force a
>> +     * redetection here.
>> +     */
>> +    temp = drmModeGetConnector(drm_fd, connector->connector_id);
>> +    drmModeFreeConnector(temp);
>> +
>> +    return true;
>> +}
>> +
>>   /**
>>    * kmstest_force_edid:
>>    * @drm_fd: drm file descriptor
>> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
>> index 6d13e5851..0abf450c1 100644
>> --- a/lib/igt_kms.h
>> +++ b/lib/igt_kms.h
>> @@ -262,6 +262,7 @@ struct edid;
>>     bool kmstest_force_connector(int fd, drmModeConnector *connector,
>>                    enum kmstest_force_connector_state state);
>> +bool kmstest_force_connector_bigjoiner(int drm_fd, drmModeConnector 
>> *connector);
>>   void kmstest_force_edid(int drm_fd, drmModeConnector *connector,
>>               const struct edid *edid);

  reply	other threads:[~2024-04-19 11:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19  6:39 [PATCH i-g-t 0/7] cleanup and fixes for kms_big_joiner Kunal Joshi
2024-04-19  6:39 ` [PATCH i-g-t 1/7] lib/igt_kms: don't run on unsupported platform Kunal Joshi
2024-04-19  9:32   ` Modem, Bhanuprakash
2024-04-19 11:31     ` Joshi, Kunal1
2024-04-19  6:39 ` [PATCH i-g-t 2/7] tests/intel/kms_big_joiner: fix crash in multi joiner test Kunal Joshi
2024-04-19  9:42   ` Modem, Bhanuprakash
2024-04-19  6:39 ` [PATCH i-g-t 3/7] tests/intel/kms_big_joiner: add missing commit after reset Kunal Joshi
2024-04-19  9:53   ` Modem, Bhanuprakash
2024-04-19 10:09     ` Joshi, Kunal1
2024-04-19 10:51       ` Modem, Bhanuprakash
2024-04-19  6:39 ` [PATCH i-g-t 4/7] lib/igt_kms: add support for forcing bigjoiner on particular connector Kunal Joshi
2024-04-19 10:26   ` Modem, Bhanuprakash
2024-04-19 11:34     ` Joshi, Kunal1 [this message]
2024-04-19  6:39 ` [PATCH i-g-t 5/7] tests/intel/kms_big_joiner: use kmstest_force_connector_bigjoiner Kunal Joshi
2024-04-19  6:40 ` [PATCH i-g-t 6/7] lib/igt_kms: remove unused igt_force_and_check_bigjoiner_status Kunal Joshi
2024-04-19 10:32   ` Modem, Bhanuprakash
2024-04-19  6:40 ` [PATCH i-g-t 7/7] HAX: Do not merge Kunal Joshi
2024-04-19  7:13 ` ✗ Fi.CI.BAT: failure for cleanup and fixes for kms_big_joiner (rev3) Patchwork
2024-04-19  7:17 ` ✓ CI.xeBAT: success " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-04-22  5:34 [PATCH i-g-t 0/7] cleanup and fixes for kms_big_joiner Kunal Joshi
2024-04-22  5:34 ` [PATCH i-g-t 4/7] lib/igt_kms: add support for forcing bigjoiner on particular connector Kunal Joshi
2024-04-22 10:59   ` Modem, Bhanuprakash
2024-04-18 15:28 [PATCH i-g-t 0/7] cleanup and fixes for kms_big_joiner Kunal Joshi
2024-04-18 15:28 ` [PATCH i-g-t 4/7] lib/igt_kms: add support for forcing bigjoiner on particular connector Kunal Joshi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7506aba-28cd-4e27-bbd0-b62afc081efd@intel.com \
    --to=kunal1.joshi@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox